Salome HOME
oubli de FrontTrack
[modules/smesh.git] / src / ADAPTFrontTrack_SWIG / CMakeLists.txt
1 # Copyright (C) 2017-2020  CEA/DEN, EDF R&D
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 # --- options ---
23 # additional include directories
24 INCLUDE_DIRECTORIES(
25   ${PYTHON_INCLUDE_DIRS}
26   ${PTHREAD_INCLUDE_DIR} # pthread dependancy due to python2.7 library
27   ${CMAKE_CURRENT_SOURCE_DIR}
28   ${PROJECT_SOURCE_DIR}/src/ADAPTFrontTrack
29 )
30
31 # additional preprocessor / compiler flags
32 ADD_DEFINITIONS(
33   ${PYTHON_DEFINITIONS}
34 )
35
36 # libraries to link to
37 SET(_link_LIBRARIES
38   ${PYTHON_LIBRARIES}
39   ${PLATFORM_LIBS}
40   ADAPTFrontTrack
41 )
42
43 # --- headers ---
44
45 # header files / to be processed by moc
46 SET(ADAPTFrontTrack_Swig_HEADERS
47   FrontTrack.i
48 )
49
50 # --- sources ---
51
52 # sources / static
53 SET(ADAPTFrontTrack_Swig_SOURCES
54   ${ADAPTFrontTrack_Swig_HEADERS}
55 )
56
57 # swig flags
58 SET_SOURCE_FILES_PROPERTIES(FrontTrack_Swig.i PROPERTIES CPLUSPLUS ON)
59 SET_SOURCE_FILES_PROPERTIES(FrontTrack_Swig.i PROPERTIES SWIG_DEFINITIONS "-shadow")
60
61 # --- scripts ---
62
63 # scripts / swig wrappings
64 SET(_swig_SCRIPTS
65   ${CMAKE_CURRENT_BINARY_DIR}/FrontTrack.py
66 )
67
68 # --- rules ---
69 IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
70   SWIG_ADD_MODULE(FrontTrack_Swig python ${ADAPTFrontTrack_Swig_SOURCES})
71 ELSE()
72   SWIG_ADD_LIBRARY(FrontTrack_Swig LANGUAGE python SOURCES ${ADAPTFrontTrack_Swig_SOURCES})
73 ENDIF()
74
75 SWIG_LINK_LIBRARIES(FrontTrack_Swig ${_link_LIBRARIES})
76 SWIG_CHECK_GENERATION(FrontTrack_Swig)
77 IF(WIN32)
78   SET_TARGET_PROPERTIES(_FrontTrack_Swig PROPERTIES DEBUG_OUTPUT_NAME _FrontTrack_Swig_d)
79 ENDIF(WIN32)
80
81 INSTALL(TARGETS ${SWIG_MODULE_FrontTrack_Swig_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
82
83 SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}" ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_FrontTrack_Swig_REAL_NAME}")