]> SALOME platform Git repositories - modules/shaper.git/blob - src/CollectionAPI/CMakeLists.txt
Salome HOME
0bf7bffa4ff751c3b2d09d53d9f7843e54d3ec89
[modules/shaper.git] / src / CollectionAPI / CMakeLists.txt
1 # Copyright (C) 2014-2019  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(Common)
21
22 SET(PROJECT_HEADERS
23   CollectionAPI.h
24   CollectionAPI_Group.h
25   CollectionAPI_GroupAddition.h
26   CollectionAPI_GroupIntersection.h
27   CollectionAPI_Field.h
28 )
29
30 SET(PROJECT_SOURCES
31   CollectionAPI_Group.cpp
32   CollectionAPI_GroupAddition.cpp
33   CollectionAPI_GroupIntersection.cpp
34   CollectionAPI_Field.cpp
35 )
36
37 SET(PROJECT_LIBRARIES
38   ModelAPI
39   ModelHighAPI
40 )
41
42 INCLUDE_DIRECTORIES(
43   ${PROJECT_SOURCE_DIR}/src/Events
44   ${PROJECT_SOURCE_DIR}/src/ModelAPI
45   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
46 )
47
48 # Plugin headers dependency
49 INCLUDE_DIRECTORIES(
50   ${PROJECT_SOURCE_DIR}/src/GeomAPI
51   ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
52   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
53   ${PROJECT_SOURCE_DIR}/src/CollectionPlugin
54 )
55
56 ADD_DEFINITIONS(-DCOLLECTIONAPI_EXPORTS)
57 ADD_LIBRARY(CollectionAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
58 TARGET_LINK_LIBRARIES(CollectionAPI ${PROJECT_LIBRARIES})
59
60 # SWIG wrapper
61
62 INCLUDE(PythonAPI)
63
64 SET(CMAKE_SWIG_FLAGS -threads -w325,321,302,362,322,383,403,509)
65
66 SET_SOURCE_FILES_PROPERTIES(CollectionAPI.i PROPERTIES CPLUSPLUS ON)
67 SET_SOURCE_FILES_PROPERTIES(CollectionAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
68
69 SET(SWIG_LINK_LIBRARIES
70   CollectionAPI
71   ModelHighAPI
72   ModelAPI
73   ${PYTHON_LIBRARIES}
74 )
75
76 SET(SWIG_MODULE_CollectionAPI_EXTRA_DEPS ${SWIG_MODULE_CollectionAPI_EXTRA_DEPS}
77   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
78   doxyhelp.i
79   ${PROJECT_HEADERS}
80 )
81
82 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
83   SWIG_ADD_LIBRARY(CollectionAPI LANGUAGE python SOURCES CollectionAPI.i ${PROJECT_HEADERS})
84 ELSE()
85   SWIG_ADD_MODULE(CollectionAPI python CollectionAPI.i ${PROJECT_HEADERS})
86 ENDIF()
87 SWIG_LINK_LIBRARIES(CollectionAPI ${SWIG_LINK_LIBRARIES})
88
89 IF(WIN32)
90   SET_TARGET_PROPERTIES(_CollectionAPI PROPERTIES DEBUG_OUTPUT_NAME _CollectionAPI_d)
91 ENDIF(WIN32)
92
93 INSTALL(TARGETS _CollectionAPI DESTINATION ${SHAPER_INSTALL_SWIG})
94 INSTALL(TARGETS CollectionAPI DESTINATION ${SHAPER_INSTALL_BIN})
95 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CollectionAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})