1 # Copyright (C) 2014-2023 CEA, EDF
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
30 ExchangeAPI_Export.cpp
31 ExchangeAPI_Import.cpp
43 ${PROJECT_SOURCE_DIR}/src/Events
44 ${PROJECT_SOURCE_DIR}/src/Locale
45 ${PROJECT_SOURCE_DIR}/src/ModelAPI
46 ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
47 ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
51 # Plugin headers dependency
53 # TODO(spo): modify ExchangePlugin headers to remove dependency on GeomAPI headers
54 ${PROJECT_SOURCE_DIR}/src/GeomAPI
55 ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
56 ${PROJECT_SOURCE_DIR}/src/ExchangePlugin
59 # additional preprocessor / compiler flags
60 ADD_DEFINITIONS(${QT_DEFINITIONS})
62 #TODO(spo): is ${OpenCASCADE_DEFINITIONS} necessary?
63 ADD_DEFINITIONS(-DEXCHANGEAPI_EXPORTS ${OpenCASCADE_DEFINITIONS})
64 ADD_LIBRARY(ExchangeAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
65 TARGET_LINK_LIBRARIES(ExchangeAPI ${PROJECT_LIBRARIES})
71 SET(CMAKE_SWIG_FLAGS -threads -w325,321,302,362,322,383,403)
73 SET_SOURCE_FILES_PROPERTIES(ExchangeAPI.i PROPERTIES CPLUSPLUS ON)
74 SET_SOURCE_FILES_PROPERTIES(ExchangeAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
76 #TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
77 SET(SWIG_LINK_LIBRARIES
84 SET(SWIG_MODULE_ExchangeAPI_EXTRA_DEPS ${SWIG_MODULE_ExchangeAPI_EXTRA_DEPS}
85 ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
90 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
91 SWIG_ADD_LIBRARY(ExchangeAPI LANGUAGE python SOURCES ExchangeAPI.i ${PROJECT_HEADERS})
93 SWIG_ADD_MODULE(ExchangeAPI python ExchangeAPI.i ${PROJECT_HEADERS})
95 SWIG_LINK_LIBRARIES(ExchangeAPI ${SWIG_LINK_LIBRARIES})
98 SET_TARGET_PROPERTIES(_ExchangeAPI PROPERTIES DEBUG_OUTPUT_NAME _ExchangeAPI_d)
101 INSTALL(TARGETS _ExchangeAPI DESTINATION ${SHAPER_INSTALL_SWIG})
102 INSTALL(TARGETS ExchangeAPI DESTINATION ${SHAPER_INSTALL_BIN})
103 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ExchangeAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
111 ADD_UNIT_TESTS(${TEST_NAMES})
115 set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/ExchangeAPI")
117 install(FILES CTestTestfileInstall.cmake
118 DESTINATION ${TEST_INSTALL_DIRECTORY}
119 RENAME CTestTestfile.cmake)
120 install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
123 foreach(tfile ${TEST_NAMES})
124 list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
125 endforeach(tfile ${TEST_NAMES})
127 install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
128 endif(${HAVE_SALOME})