]> SALOME platform Git repositories - modules/shaper.git/blob - src/BuildAPI/CMakeLists.txt
Salome HOME
[bos #24758] EDF 24017 - Problems with ExtrusionCut
[modules/shaper.git] / src / BuildAPI / CMakeLists.txt
1 # Copyright (C) 2014-2021  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   BuildAPI.h
24   BuildAPI_Compound.h
25   BuildAPI_CompSolid.h
26   BuildAPI_Edge.h
27   BuildAPI_Face.h
28   BuildAPI_Filling.h
29   BuildAPI_Shell.h
30   BuildAPI_Solid.h
31   BuildAPI_SubShapes.h
32   BuildAPI_Vertex.h
33   BuildAPI_Wire.h
34   BuildAPI_Polyline.h
35   BuildAPI_Interpolation.h
36 )
37
38 SET(PROJECT_SOURCES
39   BuildAPI_Compound.cpp
40   BuildAPI_CompSolid.cpp
41   BuildAPI_Edge.cpp
42   BuildAPI_Face.cpp
43   BuildAPI_Filling.cpp
44   BuildAPI_Shell.cpp
45   BuildAPI_Solid.cpp
46   BuildAPI_SubShapes.cpp
47   BuildAPI_Vertex.cpp
48   BuildAPI_Wire.cpp
49   BuildAPI_Polyline.cpp
50   BuildAPI_Interpolation.cpp
51 )
52
53 SET(PROJECT_LIBRARIES
54   ModelAPI
55   ModelHighAPI
56 )
57
58 INCLUDE_DIRECTORIES(
59   ${PROJECT_SOURCE_DIR}/src/Events
60   ${PROJECT_SOURCE_DIR}/src/ModelAPI
61   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
62 )
63
64 # Plugin headers dependency
65 INCLUDE_DIRECTORIES(
66   ${PROJECT_SOURCE_DIR}/src/GeomAPI
67   ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
68   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
69   ${PROJECT_SOURCE_DIR}/src/BuildPlugin
70 )
71
72 #TODO(spo): is ${OpenCASCADE_DEFINITIONS} necessary?
73 ADD_DEFINITIONS(-DBUILDAPI_EXPORTS ${OpenCASCADE_DEFINITIONS})
74 ADD_LIBRARY(BuildAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
75 TARGET_LINK_LIBRARIES(BuildAPI ${PROJECT_LIBRARIES})
76
77 # SWIG wrapper
78
79 INCLUDE(PythonAPI)
80
81 SET_SOURCE_FILES_PROPERTIES(BuildAPI.i PROPERTIES CPLUSPLUS ON)
82 SET_SOURCE_FILES_PROPERTIES(BuildAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
83
84 #TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
85 SET(SWIG_LINK_LIBRARIES
86   BuildAPI
87   ModelHighAPI
88   ModelAPI
89   ${PYTHON_LIBRARIES}
90 )
91 SET(CMAKE_SWIG_FLAGS -threads -w325,321,302,362,322,383,403)
92
93 SET(SWIG_MODULE_BuildAPI_EXTRA_DEPS ${SWIG_MODULE_BuildAPI_EXTRA_DEPS}
94   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
95   doxyhelp.i
96   ${PROJECT_HEADERS}
97 )
98
99 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
100   SWIG_ADD_LIBRARY(BuildAPI LANGUAGE python SOURCES BuildAPI.i ${PROJECT_HEADERS})
101 ELSE()
102   SWIG_ADD_MODULE(BuildAPI python BuildAPI.i ${PROJECT_HEADERS})
103 ENDIF()
104 SWIG_LINK_LIBRARIES(BuildAPI ${SWIG_LINK_LIBRARIES})
105
106 IF(WIN32)
107   SET_TARGET_PROPERTIES(_BuildAPI PROPERTIES DEBUG_OUTPUT_NAME _BuildAPI_d)
108 ENDIF(WIN32)
109
110 INSTALL(TARGETS _BuildAPI DESTINATION ${SHAPER_INSTALL_SWIG})
111 INSTALL(TARGETS BuildAPI DESTINATION ${SHAPER_INSTALL_BIN})
112 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/BuildAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
113
114 # Tests
115 INCLUDE(UnitTest)
116
117 ADD_UNIT_TESTS(
118 )
119
120 # ADD_SUBDIRECTORY (Test)