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