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
30 ExchangeAPI_Export.cpp
31 ExchangeAPI_Import.cpp
42 ${PROJECT_SOURCE_DIR}/src/Events
43 ${PROJECT_SOURCE_DIR}/src/ModelAPI
44 ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
45 ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
49 # Plugin headers dependency
51 # TODO(spo): modify ExchangePlugin headers to remove dependency on GeomAPI headers
52 ${PROJECT_SOURCE_DIR}/src/GeomAPI
53 ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
54 ${PROJECT_SOURCE_DIR}/src/ExchangePlugin
57 # additional preprocessor / compiler flags
58 ADD_DEFINITIONS(${QT_DEFINITIONS})
60 #TODO(spo): is ${OpenCASCADE_DEFINITIONS} necessary?
61 ADD_DEFINITIONS(-DEXCHANGEAPI_EXPORTS ${OpenCASCADE_DEFINITIONS})
62 ADD_LIBRARY(ExchangeAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
63 TARGET_LINK_LIBRARIES(ExchangeAPI ${PROJECT_LIBRARIES})
69 SET(CMAKE_SWIG_FLAGS -threads -w325,321,302,362,322,383,403)
71 SET_SOURCE_FILES_PROPERTIES(ExchangeAPI.i PROPERTIES CPLUSPLUS ON)
72 SET_SOURCE_FILES_PROPERTIES(ExchangeAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
74 #TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
75 SET(SWIG_LINK_LIBRARIES
82 SET(SWIG_MODULE_ExchangeAPI_EXTRA_DEPS ${SWIG_MODULE_ExchangeAPI_EXTRA_DEPS}
83 ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
88 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
89 SWIG_ADD_LIBRARY(ExchangeAPI LANGUAGE python SOURCES ExchangeAPI.i ${PROJECT_HEADERS})
91 SWIG_ADD_MODULE(ExchangeAPI python ExchangeAPI.i ${PROJECT_HEADERS})
93 SWIG_LINK_LIBRARIES(ExchangeAPI ${SWIG_LINK_LIBRARIES})
96 SET_TARGET_PROPERTIES(_ExchangeAPI PROPERTIES DEBUG_OUTPUT_NAME _ExchangeAPI_d)
99 INSTALL(TARGETS _ExchangeAPI DESTINATION ${SHAPER_INSTALL_SWIG})
100 INSTALL(TARGETS ExchangeAPI DESTINATION ${SHAPER_INSTALL_BIN})
101 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ExchangeAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
109 ADD_UNIT_TESTS(${TEST_NAMES})
113 set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/ExchangeAPI")
115 install(FILES CTestTestfileInstall.cmake
116 DESTINATION ${TEST_INSTALL_DIRECTORY}
117 RENAME CTestTestfile.cmake)
118 install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
121 foreach(tfile ${TEST_NAMES})
122 list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
123 endforeach(tfile ${TEST_NAMES})
125 install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
126 endif(${HAVE_SALOME})