Salome HOME
Updated copyright comment
[modules/shaper.git] / src / GeomAlgoAPI / CMakeLists.txt
1 # Copyright (C) 2014-2024  CEA, EDF
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 FIND_PACKAGE(SWIG REQUIRED)
21
22 INCLUDE(${SWIG_USE_FILE})
23 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
24
25 SET(PROJECT_HEADERS
26     GeomAlgoAPI.h
27     GeomAlgoAPI_Tools.h
28     GeomAlgoAPI_CompoundBuilder.h
29     GeomAlgoAPI_FaceBuilder.h
30     GeomAlgoAPI_EdgeBuilder.h
31     GeomAlgoAPI_PointBuilder.h
32     GeomAlgoAPI_SketchBuilder.h
33     GeomAlgoAPI_Prism.h
34     GeomAlgoAPI_Revolution.h
35     GeomAlgoAPI_Boolean.h
36     GeomAlgoAPI_ThroughAll.h
37     GeomAlgoAPI_Rotation.h
38     GeomAlgoAPI_Translation.h
39     GeomAlgoAPI_MakeShape.h
40     GeomAlgoAPI_MakeShapeCustom.h
41     GeomAlgoAPI_MakeShapeList.h
42     GeomAlgoAPI_MakeShapeSet.h
43     GeomAlgoAPI_MakeSweep.h
44     GeomAlgoAPI_MakeVolume.h
45     GeomAlgoAPI_DFLoader.h
46     GeomAlgoAPI_Placement.h
47     GeomAlgoAPI_BREPImport.h
48     GeomAlgoAPI_STEPImport.h
49     GeomAlgoAPI_STEPImportXCAF.h
50     GeomAlgoAPI_IGESImport.h
51     GeomAlgoAPI_BREPExport.h
52     GeomAlgoAPI_STEPExport.h
53     GeomAlgoAPI_STLExport.h
54     GeomAlgoAPI_STLImport.h
55     GeomAlgoAPI_ImageImport.h
56     GeomAlgoAPI_IGESExport.h
57     GeomAlgoAPI_Transform.h
58     GeomAlgoAPI_ShapeTools.h
59     GeomAlgoAPI_Partition.h
60     GeomAlgoAPI_PaveFiller.h
61     GeomAlgoAPI_PointCloudOnFace.h
62     GeomAlgoAPI_Intersection.h
63     GeomAlgoAPI_Pipe.h
64     GeomAlgoAPI_Loft.h
65     GeomAlgoAPI_WireBuilder.h
66     GeomAlgoAPI_Sewing.h
67     GeomAlgoAPI_ShapeBuilder.h
68     GeomAlgoAPI_ShapeAPI.h
69     GeomAlgoAPI_Exception.h
70     GeomAlgoAPI_Box.h
71     GeomAlgoAPI_Cone.h
72     GeomAlgoAPI_Cylinder.h
73     GeomAlgoAPI_Sphere.h
74     GeomAlgoAPI_Torus.h
75     GeomAlgoAPI_XAOExport.h
76     GeomAlgoAPI_XAOImport.h
77     GeomAlgoAPI_Copy.h
78     GeomAlgoAPI_ConeSegment.h
79     GeomAlgoAPI_Ellipsoid.h
80     GeomAlgoAPI_Symmetry.h
81     GeomAlgoAPI_Scale.h
82     GeomAlgoAPI_Circ2dBuilder.h
83     GeomAlgoAPI_UnifySameDomain.h
84     GeomAlgoAPI_Fillet.h
85     GeomAlgoAPI_Fillet1D.h
86     GeomAlgoAPI_SortListOfShapes.h
87     GeomAlgoAPI_Filling.h
88     GeomAlgoAPI_CurveBuilder.h
89     GeomAlgoAPI_NExplode.h
90     GeomAlgoAPI_Offset.h
91     GeomAlgoAPI_SolidClassifier.h
92     GeomAlgoAPI_MapShapesAndAncestors.h
93     GeomAlgoAPI_Projection.h
94     GeomAlgoAPI_Chamfer.h
95     GeomAlgoAPI_Defeaturing.h
96     GeomAlgoAPI_BoundingBox.h
97     GeomAlgoAPI_NormalToFace.h
98     GeomAlgoAPI_Tube.h
99     GeomAlgoAPI_ShapeInfo.h
100           GeomAlgoAPI_CanonicalRecognition.h
101     GeomAlgoAPI_GlueFaces.h
102     GeomAlgoAPI_LimitTolerance.h
103     GeomAlgoAPI_Utils.h
104     GeomAlgoAPI_NonPlanarFace.h
105 )
106
107 SET(PROJECT_SOURCES
108     GeomAlgoAPI_Tools.cpp
109     GeomAlgoAPI_CompoundBuilder.cpp
110     GeomAlgoAPI_FaceBuilder.cpp
111     GeomAlgoAPI_EdgeBuilder.cpp
112     GeomAlgoAPI_PointBuilder.cpp
113     GeomAlgoAPI_SketchBuilder.cpp
114     GeomAlgoAPI_Prism.cpp
115     GeomAlgoAPI_Revolution.cpp
116     GeomAlgoAPI_Boolean.cpp
117     GeomAlgoAPI_ThroughAll.cpp
118     GeomAlgoAPI_Rotation.cpp
119     GeomAlgoAPI_Translation.cpp
120     GeomAlgoAPI_MakeShape.cpp
121     GeomAlgoAPI_MakeShapeCustom.cpp
122     GeomAlgoAPI_MakeShapeList.cpp
123     GeomAlgoAPI_MakeShapeSet.cpp
124     GeomAlgoAPI_MakeSweep.cpp
125     GeomAlgoAPI_MakeVolume.cpp
126     GeomAlgoAPI_DFLoader.cpp
127     GeomAlgoAPI_Placement.cpp
128     GeomAlgoAPI_BREPImport.cpp
129     GeomAlgoAPI_STEPImport.cpp
130     GeomAlgoAPI_STEPImportXCAF.cpp
131     GeomAlgoAPI_IGESImport.cpp
132     GeomAlgoAPI_BREPExport.cpp
133     GeomAlgoAPI_STEPExport.cpp
134     GeomAlgoAPI_STLExport.cpp
135     GeomAlgoAPI_STLImport.cpp
136     GeomAlgoAPI_ImageImport.cpp
137     GeomAlgoAPI_IGESExport.cpp
138     GeomAlgoAPI_Transform.cpp
139     GeomAlgoAPI_ShapeTools.cpp
140     GeomAlgoAPI_Partition.cpp
141     GeomAlgoAPI_PaveFiller.cpp
142     GeomAlgoAPI_PointCloudOnFace.cpp
143     GeomAlgoAPI_Intersection.cpp
144     GeomAlgoAPI_Pipe.cpp
145     GeomAlgoAPI_Loft.cpp
146     GeomAlgoAPI_WireBuilder.cpp
147     GeomAlgoAPI_Sewing.cpp
148     GeomAlgoAPI_ShapeBuilder.cpp
149     GeomAlgoAPI_ShapeAPI.cpp
150     GeomAlgoAPI_Exception.cpp
151     GeomAlgoAPI_Box.cpp
152     GeomAlgoAPI_Cone.cpp
153     GeomAlgoAPI_Cylinder.cpp
154     GeomAlgoAPI_Sphere.cpp
155     GeomAlgoAPI_Torus.cpp
156     GeomAlgoAPI_XAOExport.cpp
157     GeomAlgoAPI_XAOImport.cpp
158     GeomAlgoAPI_Copy.cpp
159     GeomAlgoAPI_ConeSegment.cpp
160     GeomAlgoAPI_Ellipsoid.cpp
161     GeomAlgoAPI_Symmetry.cpp
162     GeomAlgoAPI_Scale.cpp
163     GeomAlgoAPI_Circ2dBuilder.cpp
164     GeomAlgoAPI_UnifySameDomain.cpp
165     GeomAlgoAPI_Fillet.cpp
166     GeomAlgoAPI_Fillet1D.cpp
167     GeomAlgoAPI_SortListOfShapes.cpp
168     GeomAlgoAPI_Filling.cpp
169     GeomAlgoAPI_CurveBuilder.cpp
170     GeomAlgoAPI_NExplode.cpp
171     GeomAlgoAPI_Offset.cpp
172     GeomAlgoAPI_SolidClassifier.cpp
173     GeomAlgoAPI_MapShapesAndAncestors.cpp
174     GeomAlgoAPI_Projection.cpp
175     GeomAlgoAPI_Chamfer.cpp
176     GeomAlgoAPI_Defeaturing.cpp
177     GeomAlgoAPI_BoundingBox.cpp
178     GeomAlgoAPI_NormalToFace.cpp
179     GeomAlgoAPI_Tube.cpp
180     GeomAlgoAPI_ShapeInfo.cpp
181           GeomAlgoAPI_CanonicalRecognition.cpp
182     GeomAlgoAPI_GlueFaces.cpp
183         GeomAlgoAPI_CanonicalRecognition.cpp
184     GeomAlgoAPI_LimitTolerance.cpp
185     GeomAlgoAPI_Utils.cpp
186     GeomAlgoAPI_NonPlanarFace.cpp
187 )
188
189 SET(PROJECT_LIBRARIES
190     GeomAPI
191     GeomAlgoImpl
192     ModelAPI
193     XAOShaper
194     ${OpenCASCADE_DataExchange_LIBRARIES}
195     ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
196     ${OpenCASCADE_ApplicationFramework_LIBRARIES}
197 )
198
199 ADD_DEFINITIONS(-DGEOMALGOAPI_EXPORTS ${OpenCASCADE_DEFINITIONS})
200 ADD_LIBRARY(GeomAlgoAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
201
202 SET(CMAKE_SWIG_FLAGS -w325,321,362,383,302)
203
204 SET_SOURCE_FILES_PROPERTIES(GeomAlgoAPI.i PROPERTIES CPLUSPLUS ON)
205 SET_SOURCE_FILES_PROPERTIES(GeomAlgoAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
206
207 # additional include directories
208 INCLUDE_DIRECTORIES(
209   ../GeomAPI
210   ../GeomAlgoImpl
211   ../ModelAPI
212   ../XAO
213   ${PROJECT_SOURCE_DIR}/src/Locale
214   ${OpenCASCADE_INCLUDE_DIR}
215 )
216
217 TARGET_LINK_LIBRARIES(GeomAlgoAPI ${PROJECT_LIBRARIES})
218
219 SET(SWIG_SCRIPTS
220   ${CMAKE_CURRENT_BINARY_DIR}/GeomAlgoAPI.py
221 )
222
223 SET(SWIG_LINK_LIBRARIES
224   GeomAPI
225   GeomAlgoAPI
226   GeomAlgoImpl
227   ${PYTHON_LIBRARIES}
228 )
229
230 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
231   SWIG_ADD_LIBRARY(GeomAlgoAPI LANGUAGE python SOURCES GeomAlgoAPI.i ${PROJECT_HEADERS})
232 ELSE()
233   SWIG_ADD_MODULE(GeomAlgoAPI python GeomAlgoAPI.i ${PROJECT_HEADERS})
234 ENDIF()
235 SWIG_LINK_LIBRARIES(GeomAlgoAPI ${SWIG_LINK_LIBRARIES})
236
237 IF(WIN32)
238   SET_TARGET_PROPERTIES(_GeomAlgoAPI PROPERTIES DEBUG_OUTPUT_NAME _GeomAlgoAPI_d)
239 ENDIF(WIN32)
240
241 INSTALL(TARGETS _GeomAlgoAPI DESTINATION ${SHAPER_INSTALL_SWIG})
242 INSTALL(TARGETS GeomAlgoAPI DESTINATION ${SHAPER_INSTALL_BIN})
243 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
244