]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/CMakeLists.txt
Salome HOME
Porting to SALOME_8.2.0 : Debug visualization selection for AIS_Trihedron axes.
[modules/shaper.git] / src / ModelAPI / CMakeLists.txt
1 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 FIND_PACKAGE(SWIG REQUIRED)
4 INCLUDE(${SWIG_USE_FILE})
5 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
6 INCLUDE(UnitTest)
7
8 SET(PROJECT_HEADERS
9     ModelAPI.h
10     ModelAPI_Attribute.h
11     ModelAPI_AttributeBoolean.h
12     ModelAPI_AttributeIntArray.h
13     ModelAPI_AttributeDocRef.h
14     ModelAPI_AttributeDouble.h
15     ModelAPI_AttributeDoubleArray.h
16     ModelAPI_AttributeInteger.h
17     ModelAPI_AttributeRefAttr.h
18     ModelAPI_AttributeReference.h
19     ModelAPI_AttributeRefAttrList.h
20     ModelAPI_AttributeRefList.h
21     ModelAPI_AttributeSelection.h
22     ModelAPI_AttributeSelectionList.h
23     ModelAPI_AttributeString.h
24     ModelAPI_AttributeStringArray.h
25     ModelAPI_AttributeTables.h
26     ModelAPI_AttributeValidator.h
27     ModelAPI_BodyBuilder.h
28     ModelAPI_CompositeFeature.h
29     ModelAPI_Data.h
30     ModelAPI_Document.h
31     ModelAPI_Events.h
32     ModelAPI_Expression.h
33     ModelAPI_Feature.h
34     ModelAPI_FeatureValidator.h
35     ModelAPI_Object.h
36     ModelAPI_Plugin.h
37     ModelAPI_Result.h
38     ModelAPI_ResultBody.h
39     ModelAPI_ResultCompSolid.h
40     ModelAPI_ResultConstruction.h
41     ModelAPI_ResultField.h
42     ModelAPI_ResultGroup.h
43     ModelAPI_ResultParameter.h
44     ModelAPI_ResultPart.h
45     ModelAPI_Session.h
46     ModelAPI_Tools.h
47     ModelAPI_Validator.h
48     ModelAPI_Entity.h
49 )
50
51 SET(PROJECT_SOURCES
52     ModelAPI_Attribute.cpp
53     ModelAPI_AttributeBoolean.cpp
54     ModelAPI_AttributeIntArray.cpp
55     ModelAPI_AttributeDocRef.cpp
56     ModelAPI_AttributeDouble.cpp
57     ModelAPI_AttributeDoubleArray.cpp
58     ModelAPI_AttributeInteger.cpp
59     ModelAPI_AttributeRefAttr.cpp
60     ModelAPI_AttributeReference.cpp
61     ModelAPI_AttributeRefAttrList.cpp
62     ModelAPI_AttributeRefList.cpp
63     ModelAPI_AttributeSelection.cpp
64     ModelAPI_AttributeSelectionList.cpp
65     ModelAPI_AttributeString.cpp
66     ModelAPI_AttributeStringArray.cpp
67     ModelAPI_AttributeTables.cpp
68     ModelAPI_BodyBuilder.cpp
69     ModelAPI_CompositeFeature.cpp
70     ModelAPI_Data.cpp
71     ModelAPI_Document.cpp
72     ModelAPI_Events.cpp
73     ModelAPI_Expression.cpp
74     ModelAPI_Feature.cpp
75     ModelAPI_FeatureValidator.cpp
76     ModelAPI_Object.cpp
77     ModelAPI_Plugin.cpp
78     ModelAPI_Result.cpp
79     ModelAPI_ResultBody.cpp
80     ModelAPI_ResultCompSolid.cpp
81     ModelAPI_ResultConstruction.cpp
82     ModelAPI_ResultField.cpp
83     ModelAPI_ResultGroup.cpp
84     ModelAPI_ResultPart.cpp
85     ModelAPI_ResultParameter.cpp
86     ModelAPI_Session.cpp
87     ModelAPI_Tools.cpp
88     ModelAPI_AttributeValidator.cpp
89 )
90
91 SET(PROJECT_LIBRARIES
92     Config
93 )
94 SET(CMAKE_SWIG_FLAGS -threads -Wall)
95 ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
96
97 ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
98 SET_TARGET_PROPERTIES(ModelAPI PROPERTIES LINKER_LANGUAGE CXX)
99 TARGET_LINK_LIBRARIES(ModelAPI ${PROJECT_LIBRARIES})
100
101 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Config
102                     ${PROJECT_SOURCE_DIR}/src/Events
103                     ${PROJECT_SOURCE_DIR}/src/GeomAPI
104                     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
105 )
106
107
108 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES CPLUSPLUS ON)
109 # "-includeall" is not needed: it starts to follow the standard inludes (like "string") without success
110 # SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_FLAGS)
111 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
112 #SET_SOURCE_FILES_PROPERTIES(ModelAPIPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-D_WIN32")
113
114 SET(SWIG_SCRIPTS
115   ${CMAKE_CURRENT_BINARY_DIR}/ModelAPI.py
116 )
117
118 SET(SWIG_LINK_LIBRARIES
119   ModelAPI
120   GeomAPI
121   ${PYTHON_LIBRARIES}
122 )
123
124 SWIG_ADD_MODULE(ModelAPI python ModelAPI.i ${PROJECT_HEADERS})
125 SWIG_LINK_LIBRARIES(ModelAPI ${SWIG_LINK_LIBRARIES})
126
127 IF(WIN32)
128   SET_TARGET_PROPERTIES(_ModelAPI PROPERTIES DEBUG_OUTPUT_NAME _ModelAPI_d)
129 ENDIF(WIN32)
130
131 INSTALL(TARGETS _ModelAPI DESTINATION ${SHAPER_INSTALL_SWIG})
132 INSTALL(TARGETS ModelAPI DESTINATION ${SHAPER_INSTALL_BIN})
133 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
134
135 ADD_UNIT_TESTS(TestConstants.py
136                TestUndoRedo.py
137                TestDocument.py
138                Test1064.py
139                TestResults.py
140                TestIntArray.py
141                Test1512.py
142                TestDoubleArray.py
143                Test1757.py
144 )