]> SALOME platform Git repositories - modules/shaper.git/blob - src/ExchangeAPI/CMakeLists.txt
Salome HOME
Fixed validators for Boolean and Intersection
[modules/shaper.git] / src / ExchangeAPI / CMakeLists.txt
1 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 INCLUDE(Common)
4
5 SET(PROJECT_HEADERS
6   ExchangeAPI.h
7   ExchangeAPI_Export.h
8   ExchangeAPI_Import.h
9 )
10
11 SET(PROJECT_SOURCES
12   ExchangeAPI_Export.cpp
13   ExchangeAPI_Import.cpp
14 )
15
16 SET(PROJECT_LIBRARIES
17   ModelAPI
18   ModelHighAPI
19 )
20
21 INCLUDE_DIRECTORIES(
22   ${PROJECT_SOURCE_DIR}/src/Events
23   ${PROJECT_SOURCE_DIR}/src/ModelAPI
24   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
25 )
26
27 # Plugin headers dependency
28 INCLUDE_DIRECTORIES(
29   # TODO(spo): modify ExchangePlugin headers to remove dependency on GeomAPI headers
30   ${PROJECT_SOURCE_DIR}/src/GeomAPI
31   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
32   ${PROJECT_SOURCE_DIR}/src/ExchangePlugin
33 )
34
35 #TODO(spo): is ${CAS_DEFINITIONS} necessary?
36 ADD_DEFINITIONS(-DEXCHANGEAPI_EXPORTS ${CAS_DEFINITIONS})
37 ADD_LIBRARY(ExchangeAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
38 TARGET_LINK_LIBRARIES(ExchangeAPI ${PROJECT_LIBRARIES})
39
40 # SWIG wrapper
41
42 INCLUDE(PythonAPI)
43
44 SET_SOURCE_FILES_PROPERTIES(ExchangeAPI.i PROPERTIES CPLUSPLUS ON)
45 SET_SOURCE_FILES_PROPERTIES(ExchangeAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
46
47 #TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
48 SET(SWIG_LINK_LIBRARIES
49   ExchangeAPI
50   ModelHighAPI
51   ModelAPI
52   ${PYTHON_LIBRARIES}
53 )
54
55 SET(SWIG_MODULE_ExchangeAPI_EXTRA_DEPS ${SWIG_MODULE_ExchangeAPI_EXTRA_DEPS}
56   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
57   doxyhelp.i
58   ${PROJECT_HEADERS}
59 )
60
61 SWIG_ADD_MODULE(ExchangeAPI python ExchangeAPI.i ${PROJECT_HEADERS})
62 SWIG_LINK_LIBRARIES(ExchangeAPI ${SWIG_LINK_LIBRARIES})
63
64 IF(WIN32)
65   SET_TARGET_PROPERTIES(_ExchangeAPI PROPERTIES DEBUG_OUTPUT_NAME _ExchangeAPI_d)
66 ENDIF(WIN32)
67
68 INSTALL(TARGETS _ExchangeAPI DESTINATION ${SHAPER_INSTALL_SWIG})
69 INSTALL(TARGETS ExchangeAPI DESTINATION ${SHAPER_INSTALL_BIN})
70 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ExchangeAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
71
72 # Tests
73
74 INCLUDE(UnitTest)
75
76 ADD_UNIT_TESTS(
77   TestExchange.py
78 )
79
80 # ADD_SUBDIRECTORY (Test)