]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchAPI/CMakeLists.txt
Salome HOME
Porting to SALOME_8.2.0 : Debug visualization selection for AIS_Trihedron axes.
[modules/shaper.git] / src / SketchAPI / CMakeLists.txt
1 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 INCLUDE(Common)
4
5 SET(PROJECT_HEADERS
6   SketchAPI.h
7   SketchAPI_Arc.h
8   SketchAPI_Circle.h
9   SketchAPI_Constraint.h
10   SketchAPI_IntersectionPoint.h
11   SketchAPI_Line.h
12   SketchAPI_Mirror.h
13   SketchAPI_Sketch.h
14   SketchAPI_SketchEntity.h
15   SketchAPI_Point.h
16   SketchAPI_Projection.h
17   SketchAPI_Rectangle.h
18   SketchAPI_Rotation.h
19   SketchAPI_Translation.h
20 )
21
22 SET(PROJECT_SOURCES
23   SketchAPI_Arc.cpp
24   SketchAPI_Circle.cpp
25   SketchAPI_Constraint.cpp
26   SketchAPI_IntersectionPoint.cpp
27   SketchAPI_Line.cpp
28   SketchAPI_Mirror.cpp
29   SketchAPI_Sketch.cpp
30   SketchAPI_SketchEntity.cpp
31   SketchAPI_Point.cpp
32   SketchAPI_Projection.cpp
33   SketchAPI_Rectangle.cpp
34   SketchAPI_Rotation.cpp
35   SketchAPI_Translation.cpp
36 )
37
38 SET(PROJECT_LIBRARIES
39   ModelAPI
40   ModelHighAPI
41 )
42
43 INCLUDE_DIRECTORIES(
44   ${PROJECT_SOURCE_DIR}/src/Events
45   ${PROJECT_SOURCE_DIR}/src/GeomAPI
46   ${PROJECT_SOURCE_DIR}/src/ModelAPI
47   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
48   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
49   ${PROJECT_SOURCE_DIR}/src/SketcherPrs
50 )
51
52 # Plugin headers dependency
53 INCLUDE_DIRECTORIES(
54   # TODO(spo): modify ConstructionPlugin headers to remove dependency on GeomAPI headers
55   ${PROJECT_SOURCE_DIR}/src/Config
56   ${PROJECT_SOURCE_DIR}/src/GeomAPI
57   ${PROJECT_SOURCE_DIR}/src/SketchPlugin
58 )
59
60 #TODO(spo): is ${CAS_DEFINITIONS} necessary?
61 ADD_DEFINITIONS(-DSKETCHAPI_EXPORTS ${CAS_DEFINITIONS})
62 ADD_LIBRARY(SketchAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
63 TARGET_LINK_LIBRARIES(SketchAPI ${PROJECT_LIBRARIES})
64
65 # SWIG wrapper
66
67 INCLUDE(PythonAPI)
68
69 SET_SOURCE_FILES_PROPERTIES(SketchAPI.i PROPERTIES CPLUSPLUS ON)
70 SET_SOURCE_FILES_PROPERTIES(SketchAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
71
72 #TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
73 SET(SWIG_LINK_LIBRARIES
74   SketchAPI
75   ModelHighAPI
76   ModelAPI
77   ${PYTHON_LIBRARIES}
78 )
79
80 SET(SWIG_MODULE_SketchAPI_EXTRA_DEPS ${SWIG_MODULE_SketchAPI_EXTRA_DEPS}
81   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
82   doxyhelp.i
83   ${PROJECT_HEADERS}
84 )
85
86 SWIG_ADD_MODULE(SketchAPI python SketchAPI.i ${PROJECT_HEADERS})
87 SWIG_LINK_LIBRARIES(SketchAPI ${SWIG_LINK_LIBRARIES})
88
89 IF(WIN32)
90   SET_TARGET_PROPERTIES(_SketchAPI PROPERTIES DEBUG_OUTPUT_NAME _SketchAPI_d)
91 ENDIF(WIN32)
92
93 INSTALL(TARGETS _SketchAPI DESTINATION ${SHAPER_INSTALL_SWIG})
94 INSTALL(TARGETS SketchAPI DESTINATION ${SHAPER_INSTALL_BIN})
95 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SketchAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
96
97 # Tests
98
99 INCLUDE(UnitTest)
100
101 ADD_UNIT_TESTS(
102   TestSketch.py
103 )
104
105 # ADD_SUBDIRECTORY (Test)