]> SALOME platform Git repositories - modules/shaper.git/blob - src/BuildAPI/CMakeLists.txt
Salome HOME
Issue #2559: Add Polyline feature to Build plugin for 3D polyline creation.
[modules/shaper.git] / src / BuildAPI / CMakeLists.txt
1 ## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 ##
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.
7 ##
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.
12 ##
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
16 ##
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 ##
20
21 INCLUDE(Common)
22
23 SET(PROJECT_HEADERS
24   BuildAPI.h
25   BuildAPI_Compound.h
26   BuildAPI_CompSolid.h
27   BuildAPI_Edge.h
28   BuildAPI_Face.h
29   BuildAPI_Filling.h
30   BuildAPI_Shell.h
31   BuildAPI_Solid.h
32   BuildAPI_SubShapes.h
33   BuildAPI_Vertex.h
34   BuildAPI_Wire.h
35   BuildAPI_Polyline.h
36 )
37
38 SET(PROJECT_SOURCES
39   BuildAPI_Compound.cpp
40   BuildAPI_CompSolid.cpp
41   BuildAPI_Edge.cpp
42   BuildAPI_Face.cpp
43   BuildAPI_Filling.cpp
44   BuildAPI_Shell.cpp
45   BuildAPI_Solid.cpp
46   BuildAPI_SubShapes.cpp
47   BuildAPI_Vertex.cpp
48   BuildAPI_Wire.cpp
49   BuildAPI_Polyline.cpp
50 )
51
52 SET(PROJECT_LIBRARIES
53   ModelAPI
54   ModelHighAPI
55 )
56
57 INCLUDE_DIRECTORIES(
58   ${PROJECT_SOURCE_DIR}/src/Events
59   ${PROJECT_SOURCE_DIR}/src/ModelAPI
60   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
61 )
62
63 # Plugin headers dependency
64 INCLUDE_DIRECTORIES(
65   ${PROJECT_SOURCE_DIR}/src/GeomAPI
66   ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
67   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
68   ${PROJECT_SOURCE_DIR}/src/BuildPlugin
69 )
70
71 #TODO(spo): is ${CAS_DEFINITIONS} necessary?
72 ADD_DEFINITIONS(-DBUILDAPI_EXPORTS ${CAS_DEFINITIONS})
73 ADD_LIBRARY(BuildAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
74 TARGET_LINK_LIBRARIES(BuildAPI ${PROJECT_LIBRARIES})
75
76 # SWIG wrapper
77
78 INCLUDE(PythonAPI)
79
80 SET_SOURCE_FILES_PROPERTIES(BuildAPI.i PROPERTIES CPLUSPLUS ON)
81 SET_SOURCE_FILES_PROPERTIES(BuildAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
82
83 #TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
84 SET(SWIG_LINK_LIBRARIES
85   BuildAPI
86   ModelHighAPI
87   ModelAPI
88   ${PYTHON_LIBRARIES}
89 )
90
91 SET(SWIG_MODULE_BuildAPI_EXTRA_DEPS ${SWIG_MODULE_BuildAPI_EXTRA_DEPS}
92   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
93   doxyhelp.i
94   ${PROJECT_HEADERS}
95 )
96
97 SWIG_ADD_MODULE(BuildAPI python BuildAPI.i ${PROJECT_HEADERS})
98 SWIG_LINK_LIBRARIES(BuildAPI ${SWIG_LINK_LIBRARIES})
99
100 IF(WIN32)
101   SET_TARGET_PROPERTIES(_BuildAPI PROPERTIES DEBUG_OUTPUT_NAME _BuildAPI_d)
102 ENDIF(WIN32)
103
104 INSTALL(TARGETS _BuildAPI DESTINATION ${SHAPER_INSTALL_SWIG})
105 INSTALL(TARGETS BuildAPI DESTINATION ${SHAPER_INSTALL_BIN})
106 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/BuildAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
107
108 # Tests
109 INCLUDE(UnitTest)
110
111 ADD_UNIT_TESTS(
112 )
113
114 # ADD_SUBDIRECTORY (Test)