]> SALOME platform Git repositories - modules/kernel.git/blob - src/Launcher_SWIG/CMakeLists.txt
Salome HOME
Merge branch 'V9_9_BR'
[modules/kernel.git] / src / Launcher_SWIG / CMakeLists.txt
1 # Copyright (C) 2019-2022  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 INCLUDE(${SWIG_USE_FILE})
21
22 ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
23
24 SET(Launcher_target_name pylauncher)
25
26 IF(SALOME_USE_LIBBATCH)
27   ADD_DEFINITIONS(-DWITH_LIBBATCH)
28   SET(SWIG_MODULE_${Launcher_target_name}_EXTRA_FLAGS "-DWITH_LIBBATCH")
29 ENDIF(SALOME_USE_LIBBATCH)
30
31 SET_SOURCE_FILES_PROPERTIES(Launcher.i PROPERTIES CPLUSPLUS ON)
32 SET_SOURCE_FILES_PROPERTIES(Launcher.i PROPERTIES SWIG_FLAGS "-py3")
33
34
35 INCLUDE_DIRECTORIES(
36   ${PYTHON_INCLUDE_DIRS}
37   ${LIBBATCH_INCLUDE_DIRS}
38   ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager
39   ${CMAKE_CURRENT_SOURCE_DIR}/../Launcher
40   )
41
42 SWIG_ADD_LIBRARY(${Launcher_target_name} LANGUAGE python SOURCES Launcher.i)
43
44 IF(${MACHINE} STREQUAL WINDOWS)
45   SET_TARGET_PROPERTIES(_${Launcher_target_name} PROPERTIES DEBUG_OUTPUT_NAME _${Launcher_target_name}_d)
46 ENDIF(${MACHINE} STREQUAL WINDOWS)
47
48 SWIG_LINK_LIBRARIES(${Launcher_target_name} ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} Launcher)
49
50 SWIG_CHECK_GENERATION(${Launcher_target_name})
51
52 INSTALL(TARGETS ${SWIG_MODULE_${Launcher_target_name}_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
53
54 SET(PYFILES_TO_INSTALL ${PYFILES_TO_INSTALL} ${CMAKE_CURRENT_BINARY_DIR}/pylauncher.py)
55
56 SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_${Launcher_target_name}_REAL_NAME}")
57
58 IF(SALOME_BUILD_TESTS)
59   ADD_SUBDIRECTORY(Test)
60 ENDIF(SALOME_BUILD_TESTS)