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