Salome HOME
Update copyrights
[modules/shaper.git] / src / ModelAPI / 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 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_EventReentrantMessage.h
49     ModelAPI_Events.h
50     ModelAPI_Expression.h
51     ModelAPI_Feature.h
52     ModelAPI_FeatureValidator.h
53     ModelAPI_Folder.h
54     ModelAPI_IReentrant.h
55     ModelAPI_Object.h
56     ModelAPI_Plugin.h
57     ModelAPI_Result.h
58     ModelAPI_ResultBody.h
59     ModelAPI_ResultConstruction.h
60     ModelAPI_ResultField.h
61     ModelAPI_ResultGroup.h
62     ModelAPI_ResultParameter.h
63     ModelAPI_ResultPart.h
64     ModelAPI_Session.h
65     ModelAPI_Tools.h
66     ModelAPI_Validator.h
67     ModelAPI_Entity.h
68 )
69
70 SET(PROJECT_SOURCES
71     ModelAPI_Attribute.cpp
72     ModelAPI_AttributeBoolean.cpp
73     ModelAPI_AttributeIntArray.cpp
74     ModelAPI_AttributeDocRef.cpp
75     ModelAPI_AttributeDouble.cpp
76     ModelAPI_AttributeDoubleArray.cpp
77     ModelAPI_AttributeInteger.cpp
78     ModelAPI_AttributeRefAttr.cpp
79     ModelAPI_AttributeReference.cpp
80     ModelAPI_AttributeRefAttrList.cpp
81     ModelAPI_AttributeRefList.cpp
82     ModelAPI_AttributeSelection.cpp
83     ModelAPI_AttributeSelectionList.cpp
84     ModelAPI_AttributeString.cpp
85     ModelAPI_AttributeStringArray.cpp
86     ModelAPI_AttributeTables.cpp
87     ModelAPI_BodyBuilder.cpp
88     ModelAPI_CompositeFeature.cpp
89     ModelAPI_Data.cpp
90     ModelAPI_Document.cpp
91     ModelAPI_EventReentrantMessage.cpp
92     ModelAPI_Events.cpp
93     ModelAPI_Expression.cpp
94     ModelAPI_Feature.cpp
95     ModelAPI_FeatureValidator.cpp
96     ModelAPI_Folder.cpp
97     ModelAPI_IReentrant.cpp
98     ModelAPI_Object.cpp
99     ModelAPI_Plugin.cpp
100     ModelAPI_Result.cpp
101     ModelAPI_ResultBody.cpp
102     ModelAPI_ResultConstruction.cpp
103     ModelAPI_ResultField.cpp
104     ModelAPI_ResultGroup.cpp
105     ModelAPI_ResultPart.cpp
106     ModelAPI_ResultParameter.cpp
107     ModelAPI_Session.cpp
108     ModelAPI_Tools.cpp
109     ModelAPI_AttributeValidator.cpp
110 )
111
112 SET(PROJECT_LIBRARIES
113     Config
114     GeomAPI
115 )
116 SET(CMAKE_SWIG_FLAGS -threads -Wall)
117 ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
118
119 ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
120 SET_TARGET_PROPERTIES(ModelAPI PROPERTIES LINKER_LANGUAGE CXX)
121 TARGET_LINK_LIBRARIES(ModelAPI ${PROJECT_LIBRARIES})
122
123 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Config
124                     ${PROJECT_SOURCE_DIR}/src/Events
125                     ${PROJECT_SOURCE_DIR}/src/GeomAPI
126                     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
127 )
128
129
130 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES CPLUSPLUS ON)
131 # "-includeall" is not needed: it starts to follow the standard inludes (like "string") without success
132 # SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_FLAGS)
133 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
134 #SET_SOURCE_FILES_PROPERTIES(ModelAPIPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-D_WIN32")
135
136 SET(SWIG_SCRIPTS
137   ${CMAKE_CURRENT_BINARY_DIR}/ModelAPI.py
138 )
139
140 SET(SWIG_LINK_LIBRARIES
141   ModelAPI
142   GeomAPI
143   ${PYTHON_LIBRARIES}
144 )
145
146 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
147   SWIG_ADD_LIBRARY(ModelAPI LANGUAGE python SOURCES ModelAPI.i ${PROJECT_HEADERS})
148 ELSE()
149   SWIG_ADD_MODULE(ModelAPI python ModelAPI.i ${PROJECT_HEADERS})
150 ENDIF()
151 SWIG_LINK_LIBRARIES(ModelAPI ${SWIG_LINK_LIBRARIES})
152
153 IF(WIN32)
154   SET_TARGET_PROPERTIES(_ModelAPI PROPERTIES DEBUG_OUTPUT_NAME _ModelAPI_d)
155 ENDIF(WIN32)
156
157 INSTALL(TARGETS _ModelAPI DESTINATION ${SHAPER_INSTALL_SWIG})
158 INSTALL(TARGETS ModelAPI DESTINATION ${SHAPER_INSTALL_BIN})
159 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
160
161 ADD_UNIT_TESTS(TestConstants.py
162                TestUndoRedo.py
163                TestDocument.py
164                Test1064.py
165                TestResults.py
166                TestIntArray.py
167                Test1512.py
168                Test1562.py
169                TestDoubleArray.py
170                Test1757.py
171                Test1998.py
172                Test1995.py
173                Test2170.py
174                TestExternalConstruction.py
175                Test2228.py
176                Test2241.py
177                Test2252.py
178                Test2276.py
179                Test2389.py
180                Test2391.py
181                TestCustomName_BooleanCut.py
182                TestCustomName_CommonCompSolid.py
183                TestCustomName_CutCompSolid.py
184                TestCustomName_CutGroup.py
185                TestCustomName_DefaultName.py
186                TestCustomName_ExtrudeFace.py
187                TestCustomName_ExtrusionCut.py
188                TestCustomName_ExtrusionCutFace.py
189                TestCustomName_MultiTranslation.py
190                TestCustomName_Partition.py
191                TestCustomName_Placement.py
192                TestCustomName_Recover.py
193                TestCustomName_Rename.py
194                TestCustomName_RotateGroup.py
195                TestCustomName_Translation.py
196                TestFolder_Create.py
197                TestFolder_Update.py
198                TestFolder_Remove.py
199                TestFolder_Stability.py
200                TestFolder_CustomName.py
201                TestFolder_Empty.py
202                TestFolder_Sketch.py
203                Test2358_1.py
204                Test2358_2.py
205                Test2396.py
206                Test2401.py
207                Test2413.py
208                Test2496.py
209                Test2510.py
210                TestFeatureSelection_1.py
211                TestFeatureSelection_2.py
212                Test2607.py
213                TestBlockRecalculation.py
214                TestSelectionScope.py
215                TestSelectorShell.py
216                TestWeakNaming2125.py
217                TestWeakNaming2222.py
218                TestWeakNaming2245.py
219                TestWeakNaming2247.py
220                TestWeakNaming2248.py
221                TestWeakNaming2261.py
222                TestWeakNaming2291.py
223                TestWeakNaming2335.py
224                TestWeakNaming2375.py
225                TestWeakNaming2437.py
226                TestWeakNaming2445.py
227                TestWeakNaming2446.py
228                TestWeakNaming2452.py
229                TestWeakNamingSortOrder.py
230                Test2685.py
231                TestGeomNamingPlacement.py
232                TestGeomNamingRevolution.py
233                TestGeomNamingEdgeByFilter.py
234                TestGeomNamingSketchPlane.py
235                TestGeomNamingBoxWithFillet.py
236                TestContainerSelector.py
237                TestSaveOpen1.py
238                TestSaveOpen2.py
239                TestSelectionInitialization.py
240                Test2828.py
241                TestSelectionRestore.py
242                Test2491.py
243                Test2493.py
244                Test2627.py
245                Test2859.py
246 )