Salome HOME
9e17986982a3b6d7d701bca04d858c78c8e826ce
[tools/libbatch.git] / src / CMakeLists.txt
1 #  Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 MACRO(APPEND_CLASSES_TO_SRC_FILES)
24     FOREACH(CLASS ${ARGV})
25         LIST(APPEND SRC_FILES ${CLASS}.cxx)
26     ENDFOREACH(CLASS ${ARGV})
27     SET(SRC_FILES ${SRC_FILES} PARENT_SCOPE)
28 ENDMACRO(APPEND_CLASSES_TO_SRC_FILES)
29
30 MACRO(APPEND_CLASSES_TO_HDR_FILES)
31     FOREACH(CLASS ${ARGV})
32         LIST(APPEND HDR_FILES ${CLASS}.hxx)
33     ENDFOREACH(CLASS ${ARGV})
34     SET(HDR_FILES ${HDR_FILES} PARENT_SCOPE)
35 ENDMACRO(APPEND_CLASSES_TO_HDR_FILES)
36
37 IF (MSVC)
38   add_definitions(/wd4251 /wd4290)  # Disable annoying Visual C++ warnings
39 ENDIF (MSVC)
40
41 include_directories(${PTHREAD_INCLUDE_DIR})
42
43 add_subdirectory (Core)
44
45 IF (BUILD_LOCAL_SUBMISSION)
46     add_subdirectory (Local)
47 ENDIF (BUILD_LOCAL_SUBMISSION)
48
49 add_subdirectory (CCC)
50 add_subdirectory (LSF)
51 add_subdirectory (PBS)
52 add_subdirectory (SGE)
53 add_subdirectory (LoadLeveler)
54 add_subdirectory (Slurm)
55
56 # Vishnu is not available for Windows
57 IF (NOT WIN32)
58     add_subdirectory (Vishnu)
59 ENDIF (NOT WIN32)
60
61 add_library(batch SHARED ${SRC_FILES})
62
63 include_directories(${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Core)
64 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Local)
65 target_link_libraries(batch ${PTHREAD_LIBRARY})
66
67 IF (WIN32)
68     target_link_libraries(batch ws2_32)
69 ENDIF (WIN32)
70
71 # If necessary, activate all warnings (useful for debugging and code cleaning)
72 # add_definitions(-Wall -Werror -ansi -pedantic)
73
74 INSTALL(TARGETS batch DESTINATION lib)
75 INSTALL(FILES ${HDR_FILES} DESTINATION include/libbatch)
76
77 IF (BUILD_PYTHON_WRAPPING AND PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND SWIG_FOUND)
78     add_subdirectory (Python)
79 ENDIF (BUILD_PYTHON_WRAPPING AND PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND SWIG_FOUND)