Salome HOME
8d943e9c8cd50785f495e9a0e85d388c8c16463a
[modules/shaper.git] / src / ModelAPI / CMakeLists.txt
1 # Copyright (C) 2014-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 FIND_PACKAGE(SWIG REQUIRED)
21 INCLUDE(${SWIG_USE_FILE})
22 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
23 INCLUDE(UnitTest)
24
25 SET(PROJECT_HEADERS
26     ModelAPI.h
27     ModelAPI_Attribute.h
28     ModelAPI_AttributeBoolean.h
29     ModelAPI_AttributeIntArray.h
30     ModelAPI_AttributeDocRef.h
31     ModelAPI_AttributeDouble.h
32     ModelAPI_AttributeDoubleArray.h
33     ModelAPI_AttributeInteger.h
34     ModelAPI_AttributeRefAttr.h
35     ModelAPI_AttributeReference.h
36     ModelAPI_AttributeRefAttrList.h
37     ModelAPI_AttributeRefList.h
38     ModelAPI_AttributeSelection.h
39     ModelAPI_AttributeSelectionList.h
40     ModelAPI_AttributeString.h
41     ModelAPI_AttributeStringArray.h
42     ModelAPI_AttributeTables.h
43     ModelAPI_AttributeValidator.h
44     ModelAPI_BodyBuilder.h
45     ModelAPI_CompositeFeature.h
46     ModelAPI_Data.h
47     ModelAPI_Document.h
48     ModelAPI_Entity.h
49     ModelAPI_EventReentrantMessage.h
50     ModelAPI_Events.h
51     ModelAPI_Expression.h
52     ModelAPI_Feature.h
53     ModelAPI_FeatureValidator.h
54     ModelAPI_Filter.h
55     ModelAPI_FiltersArgs.h
56     ModelAPI_FiltersFactory.h
57     ModelAPI_FiltersFeature.h
58     ModelAPI_Folder.h
59     ModelAPI_IReentrant.h
60     ModelAPI_Object.h
61     ModelAPI_Plugin.h
62     ModelAPI_Result.h
63     ModelAPI_ResultBody.h
64     ModelAPI_ResultConstruction.h
65     ModelAPI_ResultField.h
66     ModelAPI_ResultGroup.h
67     ModelAPI_ResultParameter.h
68     ModelAPI_ResultPart.h
69     ModelAPI_Session.h
70     ModelAPI_Tools.h
71     ModelAPI_Validator.h
72 )
73
74 SET(PROJECT_SOURCES
75     ModelAPI_Attribute.cpp
76     ModelAPI_AttributeBoolean.cpp
77     ModelAPI_AttributeIntArray.cpp
78     ModelAPI_AttributeDocRef.cpp
79     ModelAPI_AttributeDouble.cpp
80     ModelAPI_AttributeDoubleArray.cpp
81     ModelAPI_AttributeInteger.cpp
82     ModelAPI_AttributeRefAttr.cpp
83     ModelAPI_AttributeReference.cpp
84     ModelAPI_AttributeRefAttrList.cpp
85     ModelAPI_AttributeRefList.cpp
86     ModelAPI_AttributeSelection.cpp
87     ModelAPI_AttributeSelectionList.cpp
88     ModelAPI_AttributeString.cpp
89     ModelAPI_AttributeStringArray.cpp
90     ModelAPI_AttributeTables.cpp
91     ModelAPI_AttributeValidator.cpp
92     ModelAPI_BodyBuilder.cpp
93     ModelAPI_CompositeFeature.cpp
94     ModelAPI_Data.cpp
95     ModelAPI_Document.cpp
96     ModelAPI_EventReentrantMessage.cpp
97     ModelAPI_Events.cpp
98     ModelAPI_Expression.cpp
99     ModelAPI_Feature.cpp
100     ModelAPI_FeatureValidator.cpp
101     ModelAPI_Filter.cpp
102     ModelAPI_Folder.cpp
103     ModelAPI_IReentrant.cpp
104     ModelAPI_Object.cpp
105     ModelAPI_Plugin.cpp
106     ModelAPI_Result.cpp
107     ModelAPI_ResultBody.cpp
108     ModelAPI_ResultConstruction.cpp
109     ModelAPI_ResultField.cpp
110     ModelAPI_ResultGroup.cpp
111     ModelAPI_ResultPart.cpp
112     ModelAPI_ResultParameter.cpp
113     ModelAPI_Session.cpp
114     ModelAPI_Tools.cpp
115 )
116
117 SET(PROJECT_LIBRARIES
118     Config
119     GeomAPI
120 )
121 SET(CMAKE_SWIG_FLAGS -threads -w325,321,362,383,302,403,451,473)
122 ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
123
124 ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
125 SET_TARGET_PROPERTIES(ModelAPI PROPERTIES LINKER_LANGUAGE CXX)
126 TARGET_LINK_LIBRARIES(ModelAPI ${PROJECT_LIBRARIES})
127
128 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Config
129                     ${PROJECT_SOURCE_DIR}/src/Events
130                     ${PROJECT_SOURCE_DIR}/src/GeomAPI
131                     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
132                     ${PROJECT_SOURCE_DIR}/src/Locale
133                     ${OpenCASCADE_INCLUDE_DIR}
134                     ${OpenCASCADE_DataExchange_LIBRARIES}
135                     ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
136                     ${OpenCASCADE_ApplicationFramework_LIBRARIES}
137
138 )
139
140
141 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES CPLUSPLUS ON)
142 # "-includeall" is not needed: it starts to follow the standard inludes (like "string") without success
143 # SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_FLAGS)
144 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
145 #SET_SOURCE_FILES_PROPERTIES(ModelAPIPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-D_WIN32")
146
147 SET(SWIG_SCRIPTS
148   ${CMAKE_CURRENT_BINARY_DIR}/ModelAPI.py
149 )
150
151 SET(SWIG_LINK_LIBRARIES
152   ModelAPI
153   GeomAPI
154   ${PYTHON_LIBRARIES}
155 )
156
157 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
158   SWIG_ADD_LIBRARY(ModelAPI LANGUAGE python SOURCES ModelAPI.i ${PROJECT_HEADERS})
159 ELSE()
160   SWIG_ADD_MODULE(ModelAPI python ModelAPI.i ${PROJECT_HEADERS})
161 ENDIF()
162 SWIG_LINK_LIBRARIES(ModelAPI ${SWIG_LINK_LIBRARIES})
163
164 IF(WIN32)
165   SET_TARGET_PROPERTIES(_ModelAPI PROPERTIES DEBUG_OUTPUT_NAME _ModelAPI_d)
166 ENDIF(WIN32)
167
168 INSTALL(TARGETS _ModelAPI DESTINATION ${SHAPER_INSTALL_SWIG})
169 INSTALL(TARGETS ModelAPI DESTINATION ${SHAPER_INSTALL_BIN})
170 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
171
172 ADD_UNIT_TESTS(TestConstants.py
173                TestUndoRedo.py
174                TestDocument.py
175                Test1064.py
176                TestResults.py
177                TestIntArray.py
178                Test1512.py
179                Test1562.py
180                TestDoubleArray.py
181                Test1757.py
182                Test1998.py
183                Test1995.py
184                Test2170.py
185                TestExternalConstruction.py
186                Test2228.py
187                Test2241.py
188                Test2252.py
189                Test2276.py
190                Test2389.py
191                Test2391.py
192                TestCustomName_BooleanCut.py
193                TestCustomName_CommonCompSolid.py
194                TestCustomName_CutCompSolid.py
195                TestCustomName_CutGroup.py
196                TestCustomName_DefaultName.py
197                TestCustomName_ExtrudeFace.py
198                TestCustomName_ExtrusionCut.py
199                TestCustomName_ExtrusionCutFace.py
200                TestCustomName_MultiTranslation.py
201                TestCustomName_Partition.py
202                TestCustomName_Placement.py
203                TestCustomName_Recover.py
204                TestCustomName_Rename.py
205                TestCustomName_RotateGroup.py
206                TestCustomName_Translation.py
207                TestFolder_Create.py
208                TestFolder_Update.py
209                TestFolder_Remove.py
210                TestFolder_Stability.py
211                TestFolder_CustomName.py
212                TestFolder_Empty.py
213                TestFolder_Sketch.py
214                Test2358_1.py
215                Test2358_2.py
216                Test2396.py
217                Test2401.py
218                Test2413.py
219                Test2496.py
220                Test2510.py
221                TestFeatureSelection_1.py
222                TestFeatureSelection_2.py
223                Test2607.py
224                TestBlockRecalculation.py
225                TestSelectionScope.py
226                TestSelectorShell.py
227                TestWeakNaming2125.py
228                TestWeakNaming2222.py
229                TestWeakNaming2245.py
230                TestWeakNaming2247.py
231                TestWeakNaming2248.py
232                TestWeakNaming2261.py
233                TestWeakNaming2291.py
234                TestWeakNaming2335.py
235                TestWeakNaming2375.py
236                TestWeakNaming2437.py
237                TestWeakNaming2445.py
238                TestWeakNaming2446.py
239                TestWeakNaming2452.py
240                TestWeakNamingSortOrder.py
241                Test2685.py
242                TestGeomNamingPlacement.py
243                TestGeomNamingRevolution.py
244                TestGeomNamingEdgeByFilter.py
245                TestGeomNamingSketchPlane.py
246                TestGeomNamingBoxWithFillet.py
247                TestContainerSelector.py
248                TestSaveOpen1.py
249                TestSaveOpen2.py
250                TestSelectionInitialization.py
251                TestSelectionCircleCenter.py
252                TestSelectionInPart.py
253                Test2828.py
254                TestSelectionRestore.py
255                Test2491.py
256                Test2493.py
257                Test2627.py
258                Test2859.py
259                Test2873.py
260                Test2901.py
261                Test2903.py
262                Test3020.py
263                Test3116.py
264                Test19019_1.py
265                Test19019_2.py
266                Test19031.py
267                Test19058.py
268                Test19217.py
269                Test19707.py
270                Test19726.py
271                Test19912.py
272                Test19932.py
273                Test19989.py
274                Test20170.py
275 )