]> SALOME platform Git repositories - modules/shaper_study.git/blob - src/SWIG/CMakeLists.txt
Salome HOME
Implementation of Open/Save and Break-Link functionality on SHAPER shapes
[modules/shaper_study.git] / src / SWIG / CMakeLists.txt
1 # Copyright (C) 2012-2019  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 # --- options ---
23 # additional include directories
24 INCLUDE_DIRECTORIES(
25   ${SHAPER_INCLUDE_DIRS}
26   ${PYTHON_INCLUDE_DIRS}
27   ${OpenCASCADE_INCLUDE_DIR}
28   ${KERNEL_INCLUDE_DIRS}
29   ${OMNIORB_INCLUDE_DIR}
30   ${CMAKE_CURRENT_SOURCE_DIR}
31   ${PROJECT_SOURCE_DIR}/src/StudyData
32 )
33
34 # additional preprocessor / compiler flags
35 ADD_DEFINITIONS(
36   ${OpenCASCADE_DEFINITIONS}
37   ${OMNIORB_DEFINITIONS}
38   ${PYTHON_DEFINITIONS}
39 )
40
41 # libraries to link to
42 SET(_link_LIBRARIES
43   StudyData
44   ${PYTHON_LIBRARIES}
45 )
46
47 # --- headers ---
48
49 # header files / to be processed by moc
50 SET(SHAPERSTUDY_Swig_HEADERS
51 )
52
53 # --- sources ---
54
55 # sources / static
56 SET(StudyData_Swig_SOURCES
57   StudyData_Swig.i
58   #${SHAPERSTUDY_Swig_HEADERS}
59 )
60
61 # workaround about SWIG_ADD_MODULE bug: remove duplicates in include directories
62 GET_DIRECTORY_PROPERTY(_cmake_include_directories INCLUDE_DIRECTORIES)
63 LIST(REMOVE_DUPLICATES _cmake_include_directories)
64 SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${_cmake_include_directories}")
65
66 # swig flags
67 SET_SOURCE_FILES_PROPERTIES(StudyData_Swig.i PROPERTIES CPLUSPLUS ON)
68 SET_SOURCE_FILES_PROPERTIES(StudyData_Swig.i PROPERTIES SWIG_FLAGS "-py3")
69 SET_SOURCE_FILES_PROPERTIES(StudyData_swig_wrap.cpp PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
70
71 # --- scripts ---
72
73 # scripts / swig wrappings
74 SET(_swig_SCRIPTS
75   ${CMAKE_CURRENT_BINARY_DIR}/StudyData_Swig.py 
76 )
77
78 # --- rules ---
79 IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
80   SWIG_ADD_MODULE(StudyData_Swig python ${StudyData_Swig_SOURCES})
81 ELSE()
82   SWIG_ADD_LIBRARY(StudyData_Swig LANGUAGE python SOURCES ${StudyData_Swig_SOURCES})
83 ENDIF()
84
85
86 SWIG_LINK_LIBRARIES(StudyData_Swig ${_link_LIBRARIES})
87 SWIG_CHECK_GENERATION(StudyData_Swig)
88 IF(WIN32)
89   SET_TARGET_PROPERTIES(_StudyData_Swig PROPERTIES DEBUG_OUTPUT_NAME _StudyData_Swig_d)
90 ENDIF(WIN32)
91
92 INSTALL(TARGETS _StudyData_Swig DESTINATION ${SALOME_INSTALL_LIBS})
93
94 INSTALL(FILES ${StudyData_Swig_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
95
96 SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_BINS} EXTRA_DPYS "${SWIG_MODULE_SHAPERSTUDY_Swig_REAL_NAME}")