]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/CMakeLists.txt
Salome HOME
Fix for the issue #2413
[modules/shaper.git] / src / ModelAPI / CMakeLists.txt
1 ## Copyright (C) 2014-2017  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
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 ##
20
21 FIND_PACKAGE(SWIG REQUIRED)
22 INCLUDE(${SWIG_USE_FILE})
23 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
24 INCLUDE(UnitTest)
25
26 SET(PROJECT_HEADERS
27     ModelAPI.h
28     ModelAPI_Attribute.h
29     ModelAPI_AttributeBoolean.h
30     ModelAPI_AttributeIntArray.h
31     ModelAPI_AttributeDocRef.h
32     ModelAPI_AttributeDouble.h
33     ModelAPI_AttributeDoubleArray.h
34     ModelAPI_AttributeInteger.h
35     ModelAPI_AttributeRefAttr.h
36     ModelAPI_AttributeReference.h
37     ModelAPI_AttributeRefAttrList.h
38     ModelAPI_AttributeRefList.h
39     ModelAPI_AttributeSelection.h
40     ModelAPI_AttributeSelectionList.h
41     ModelAPI_AttributeString.h
42     ModelAPI_AttributeStringArray.h
43     ModelAPI_AttributeTables.h
44     ModelAPI_AttributeValidator.h
45     ModelAPI_BodyBuilder.h
46     ModelAPI_CompositeFeature.h
47     ModelAPI_Data.h
48     ModelAPI_Document.h
49     ModelAPI_EventReentrantMessage.h
50     ModelAPI_Events.h
51     ModelAPI_Expression.h
52     ModelAPI_Feature.h
53     ModelAPI_FeatureValidator.h
54     ModelAPI_Folder.h
55     ModelAPI_IReentrant.h
56     ModelAPI_Object.h
57     ModelAPI_Plugin.h
58     ModelAPI_Result.h
59     ModelAPI_ResultBody.h
60     ModelAPI_ResultCompSolid.h
61     ModelAPI_ResultConstruction.h
62     ModelAPI_ResultField.h
63     ModelAPI_ResultGroup.h
64     ModelAPI_ResultParameter.h
65     ModelAPI_ResultPart.h
66     ModelAPI_Session.h
67     ModelAPI_Tools.h
68     ModelAPI_Validator.h
69     ModelAPI_Entity.h
70 )
71
72 SET(PROJECT_SOURCES
73     ModelAPI_Attribute.cpp
74     ModelAPI_AttributeBoolean.cpp
75     ModelAPI_AttributeIntArray.cpp
76     ModelAPI_AttributeDocRef.cpp
77     ModelAPI_AttributeDouble.cpp
78     ModelAPI_AttributeDoubleArray.cpp
79     ModelAPI_AttributeInteger.cpp
80     ModelAPI_AttributeRefAttr.cpp
81     ModelAPI_AttributeReference.cpp
82     ModelAPI_AttributeRefAttrList.cpp
83     ModelAPI_AttributeRefList.cpp
84     ModelAPI_AttributeSelection.cpp
85     ModelAPI_AttributeSelectionList.cpp
86     ModelAPI_AttributeString.cpp
87     ModelAPI_AttributeStringArray.cpp
88     ModelAPI_AttributeTables.cpp
89     ModelAPI_BodyBuilder.cpp
90     ModelAPI_CompositeFeature.cpp
91     ModelAPI_Data.cpp
92     ModelAPI_Document.cpp
93     ModelAPI_EventReentrantMessage.cpp
94     ModelAPI_Events.cpp
95     ModelAPI_Expression.cpp
96     ModelAPI_Feature.cpp
97     ModelAPI_FeatureValidator.cpp
98     ModelAPI_Folder.cpp
99     ModelAPI_IReentrant.cpp
100     ModelAPI_Object.cpp
101     ModelAPI_Plugin.cpp
102     ModelAPI_Result.cpp
103     ModelAPI_ResultBody.cpp
104     ModelAPI_ResultCompSolid.cpp
105     ModelAPI_ResultConstruction.cpp
106     ModelAPI_ResultField.cpp
107     ModelAPI_ResultGroup.cpp
108     ModelAPI_ResultPart.cpp
109     ModelAPI_ResultParameter.cpp
110     ModelAPI_Session.cpp
111     ModelAPI_Tools.cpp
112     ModelAPI_AttributeValidator.cpp
113 )
114
115 SET(PROJECT_LIBRARIES
116     Config
117     GeomAPI
118 )
119 SET(CMAKE_SWIG_FLAGS -threads -Wall)
120 ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
121
122 ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
123 SET_TARGET_PROPERTIES(ModelAPI PROPERTIES LINKER_LANGUAGE CXX)
124 TARGET_LINK_LIBRARIES(ModelAPI ${PROJECT_LIBRARIES})
125
126 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Config
127                     ${PROJECT_SOURCE_DIR}/src/Events
128                     ${PROJECT_SOURCE_DIR}/src/GeomAPI
129                     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
130 )
131
132
133 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES CPLUSPLUS ON)
134 # "-includeall" is not needed: it starts to follow the standard inludes (like "string") without success
135 # SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_FLAGS)
136 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
137 #SET_SOURCE_FILES_PROPERTIES(ModelAPIPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-D_WIN32")
138
139 SET(SWIG_SCRIPTS
140   ${CMAKE_CURRENT_BINARY_DIR}/ModelAPI.py
141 )
142
143 SET(SWIG_LINK_LIBRARIES
144   ModelAPI
145   GeomAPI
146   ${PYTHON_LIBRARIES}
147 )
148
149 SWIG_ADD_MODULE(ModelAPI python ModelAPI.i ${PROJECT_HEADERS})
150 SWIG_LINK_LIBRARIES(ModelAPI ${SWIG_LINK_LIBRARIES})
151
152 IF(WIN32)
153   SET_TARGET_PROPERTIES(_ModelAPI PROPERTIES DEBUG_OUTPUT_NAME _ModelAPI_d)
154 ENDIF(WIN32)
155
156 INSTALL(TARGETS _ModelAPI DESTINATION ${SHAPER_INSTALL_SWIG})
157 INSTALL(TARGETS ModelAPI DESTINATION ${SHAPER_INSTALL_BIN})
158 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
159
160 ADD_UNIT_TESTS(TestConstants.py
161                TestUndoRedo.py
162                TestDocument.py
163                Test1064.py
164                TestResults.py
165                TestIntArray.py
166                Test1512.py
167                TestDoubleArray.py
168                Test1757.py
169                Test1998.py
170                Test1995.py
171                Test2170.py
172                TestExternalConstruction.py
173                Test2228.py
174                Test2241.py
175                Test2252.py
176                Test2276.py
177                Test2389.py
178                Test2391.py
179                TestCustomName_BooleanCut.py
180                TestCustomName_CommonCompSolid.py
181                TestCustomName_CutCompSolid.py
182                TestCustomName_CutGroup.py
183                TestCustomName_DefaultName.py
184                TestCustomName_ExtrudeFace.py
185                TestCustomName_ExtrusionCut.py
186                TestCustomName_ExtrusionCutFace.py
187                TestCustomName_MultiTranslation.py
188                TestCustomName_Partition.py
189                TestCustomName_Placement.py
190                TestCustomName_Recover.py
191                TestCustomName_Rename.py
192                TestCustomName_RotateGroup.py
193                TestCustomName_Translation.py
194                TestFolder_Create.py
195                TestFolder_Update.py
196                TestFolder_Remove.py
197                TestFolder_Stability.py
198                TestFolder_CustomName.py
199                Test2358_1.py
200                Test2358_2.py
201                Test2396.py
202                Test2401.py
203                Test2413.py
204 )