Salome HOME
5ced6f8c9026a309412f4a4d295a4a8ab9f90e80
[modules/shaper.git] / src / FeaturesAPI / CMakeLists.txt
1 # Copyright (C) 2014-2022  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 email : webmaster.salome@opencascade.com
18 #
19
20 INCLUDE(Common)
21
22 SET(PROJECT_HEADERS
23   FeaturesAPI.h
24   FeaturesAPI_BooleanCut.h
25   FeaturesAPI_BooleanFuse.h
26   FeaturesAPI_BooleanCommon.h
27   FeaturesAPI_BooleanSmash.h
28   FeaturesAPI_BooleanFill.h
29   FeaturesAPI_Chamfer.h
30   FeaturesAPI_Extrusion.h
31   FeaturesAPI_ExtrusionBoolean.h
32   FeaturesAPI_Fillet.h
33   FeaturesAPI_Intersection.h
34   FeaturesAPI_Measurement.h
35   FeaturesAPI_NormalToFace.h
36   FeaturesAPI_MultiRotation.h
37   FeaturesAPI_MultiTranslation.h
38   FeaturesAPI_Partition.h
39   FeaturesAPI_Pipe.h
40   FeaturesAPI_Placement.h
41   FeaturesAPI_PointCloudOnFace.h
42   FeaturesAPI_Recover.h
43   FeaturesAPI_RemoveResults.h
44   FeaturesAPI_RemoveSubShapes.h
45   FeaturesAPI_Revolution.h
46   FeaturesAPI_RevolutionBoolean.h
47   FeaturesAPI_Rotation.h
48   FeaturesAPI_Scale.h
49   FeaturesAPI_Symmetry.h
50   FeaturesAPI_Translation.h
51   FeaturesAPI_Union.h
52   FeaturesAPI_FusionFaces.h
53   FeaturesAPI_Copy.h
54   FeaturesAPI_ImportResult.h
55   FeaturesAPI_Defeaturing.h
56   FeaturesAPI_PointCoordinates.h
57   FeaturesAPI_GeometryCalculation.h
58   FeaturesAPI_BoundingBox.h
59 )
60
61 SET(PROJECT_SOURCES
62   FeaturesAPI_BooleanCut.cpp
63   FeaturesAPI_BooleanFuse.cpp
64   FeaturesAPI_BooleanCommon.cpp
65   FeaturesAPI_BooleanSmash.cpp
66   FeaturesAPI_BooleanFill.cpp
67   FeaturesAPI_Chamfer.cpp
68   FeaturesAPI_Extrusion.cpp
69   FeaturesAPI_ExtrusionBoolean.cpp
70   FeaturesAPI_Fillet.cpp
71   FeaturesAPI_Intersection.cpp
72   FeaturesAPI_Measurement.cpp
73   FeaturesAPI_NormalToFace.cpp
74   FeaturesAPI_MultiRotation.cpp
75   FeaturesAPI_MultiTranslation.cpp
76   FeaturesAPI_Partition.cpp
77   FeaturesAPI_Pipe.cpp
78   FeaturesAPI_Placement.cpp
79   FeaturesAPI_PointCloudOnFace.cpp
80   FeaturesAPI_Recover.cpp
81   FeaturesAPI_RemoveResults.cpp
82   FeaturesAPI_RemoveSubShapes.cpp
83   FeaturesAPI_Revolution.cpp
84   FeaturesAPI_RevolutionBoolean.cpp
85   FeaturesAPI_Rotation.cpp
86   FeaturesAPI_Scale.cpp
87   FeaturesAPI_Symmetry.cpp
88   FeaturesAPI_Translation.cpp
89   FeaturesAPI_Union.cpp
90   FeaturesAPI_FusionFaces.cpp
91   FeaturesAPI_Copy.cpp
92   FeaturesAPI_ImportResult.cpp
93   FeaturesAPI_Defeaturing.cpp
94   FeaturesAPI_PointCoordinates.cpp
95   FeaturesAPI_GeometryCalculation.cpp
96   FeaturesAPI_BoundingBox.cpp
97 )
98
99 SET(PROJECT_LIBRARIES
100   ModelAPI
101   ModelHighAPI
102 )
103
104 INCLUDE_DIRECTORIES(
105   ${PROJECT_SOURCE_DIR}/src/Events
106   ${PROJECT_SOURCE_DIR}/src/ModelAPI
107   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
108 )
109
110 # Plugin headers dependency
111 INCLUDE_DIRECTORIES(
112   ${PROJECT_SOURCE_DIR}/src/GeomAPI
113   ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
114   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
115   ${PROJECT_SOURCE_DIR}/src/FeaturesPlugin
116 )
117
118 ADD_DEFINITIONS(-DFEATURESAPI_EXPORTS)
119 ADD_LIBRARY(FeaturesAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
120 TARGET_LINK_LIBRARIES(FeaturesAPI ${PROJECT_LIBRARIES})
121
122 # SWIG wrapper
123
124 INCLUDE(PythonAPI)
125
126 SET_SOURCE_FILES_PROPERTIES(FeaturesAPI.i PROPERTIES CPLUSPLUS ON)
127 SET_SOURCE_FILES_PROPERTIES(FeaturesAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
128
129 SET(SWIG_LINK_LIBRARIES
130   FeaturesAPI
131   ModelHighAPI
132   ModelAPI
133   ${PYTHON_LIBRARIES}
134 )
135 SET(CMAKE_SWIG_FLAGS -threads -w325,321,302,362,322,383,403)
136
137 SET(SWIG_MODULE_FeaturesAPI_EXTRA_DEPS ${SWIG_MODULE_FeaturesAPI_EXTRA_DEPS}
138   ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
139   doxyhelp.i
140   ${PROJECT_HEADERS}
141 )
142
143 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
144   SWIG_ADD_LIBRARY(FeaturesAPI LANGUAGE python SOURCES FeaturesAPI.i ${PROJECT_HEADERS})
145 ELSE()
146   SWIG_ADD_MODULE(FeaturesAPI python FeaturesAPI.i ${PROJECT_HEADERS})
147 ENDIF()
148 SWIG_LINK_LIBRARIES(FeaturesAPI ${SWIG_LINK_LIBRARIES})
149
150 IF(WIN32)
151   SET_TARGET_PROPERTIES(_FeaturesAPI PROPERTIES DEBUG_OUTPUT_NAME _FeaturesAPI_d)
152 ENDIF(WIN32)
153
154 INSTALL(TARGETS _FeaturesAPI DESTINATION ${SHAPER_INSTALL_SWIG})
155 INSTALL(TARGETS FeaturesAPI DESTINATION ${SHAPER_INSTALL_BIN})
156 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/FeaturesAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})