1 # Copyright (C) 2014-2021 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 FIND_PACKAGE(SWIG REQUIRED)
21 INCLUDE(${SWIG_USE_FILE})
22 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
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
49 ModelAPI_EventReentrantMessage.h
53 ModelAPI_FeatureValidator.h
55 ModelAPI_FiltersArgs.h
56 ModelAPI_FiltersFactory.h
57 ModelAPI_FiltersFeature.h
64 ModelAPI_ResultConstruction.h
65 ModelAPI_ResultField.h
66 ModelAPI_ResultGroup.h
67 ModelAPI_ResultParameter.h
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
96 ModelAPI_EventReentrantMessage.cpp
98 ModelAPI_Expression.cpp
100 ModelAPI_FeatureValidator.cpp
103 ModelAPI_IReentrant.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
117 SET(PROJECT_LIBRARIES
122 SET(CMAKE_SWIG_FLAGS -threads -w325,321,362,383,302,403,451,473)
123 ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
126 ADD_DEFINITIONS(-DTINSPECTOR)
129 ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
130 SET_TARGET_PROPERTIES(ModelAPI PROPERTIES LINKER_LANGUAGE CXX)
131 TARGET_LINK_LIBRARIES(ModelAPI ${PROJECT_LIBRARIES})
133 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Config
134 ${PROJECT_SOURCE_DIR}/src/Events
135 ${PROJECT_SOURCE_DIR}/src/GeomAPI
136 ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
137 ${PROJECT_SOURCE_DIR}/src/Locale
138 ${OpenCASCADE_INCLUDE_DIR}
142 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES CPLUSPLUS ON)
143 # "-includeall" is not needed: it starts to follow the standard inludes (like "string") without success
144 # SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_FLAGS)
145 SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
146 #SET_SOURCE_FILES_PROPERTIES(ModelAPIPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-D_WIN32")
149 ${CMAKE_CURRENT_BINARY_DIR}/ModelAPI.py
152 SET(SWIG_LINK_LIBRARIES
158 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
159 SWIG_ADD_LIBRARY(ModelAPI LANGUAGE python SOURCES ModelAPI.i ${PROJECT_HEADERS})
161 SWIG_ADD_MODULE(ModelAPI python ModelAPI.i ${PROJECT_HEADERS})
163 SWIG_LINK_LIBRARIES(ModelAPI ${SWIG_LINK_LIBRARIES})
166 SET_TARGET_PROPERTIES(_ModelAPI PROPERTIES DEBUG_OUTPUT_NAME _ModelAPI_d)
169 INSTALL(TARGETS _ModelAPI DESTINATION ${SHAPER_INSTALL_SWIG})
170 INSTALL(TARGETS ModelAPI DESTINATION ${SHAPER_INSTALL_BIN})
171 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
175 ADD_UNIT_TESTS(${TEST_NAMES})
179 set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/ModelAPI")
181 install(FILES CTestTestfileInstall.cmake
182 DESTINATION ${TEST_INSTALL_DIRECTORY}
183 RENAME CTestTestfile.cmake)
184 install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
187 foreach(tfile ${TEST_NAMES})
188 list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
189 endforeach(tfile ${TEST_NAMES})
191 install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
192 endif(${HAVE_SALOME})