Salome HOME
Merge remote-tracking branch 'origin/CEA_2019'
[modules/shaper.git] / src / GeomAlgoAPI / CMakeLists.txt
1 # Copyright (C) 2014-2019  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 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_Rotation.h
37     GeomAlgoAPI_Translation.h
38     GeomAlgoAPI_MakeShape.h
39     GeomAlgoAPI_MakeShapeCustom.h
40     GeomAlgoAPI_MakeShapeList.h
41     GeomAlgoAPI_MakeSweep.h
42     GeomAlgoAPI_MakeVolume.h
43     GeomAlgoAPI_DFLoader.h
44     GeomAlgoAPI_Placement.h
45     GeomAlgoAPI_BREPImport.h
46     GeomAlgoAPI_STEPImport.h
47     GeomAlgoAPI_IGESImport.h
48     GeomAlgoAPI_BREPExport.h
49     GeomAlgoAPI_STEPExport.h
50     GeomAlgoAPI_IGESExport.h
51     GeomAlgoAPI_Transform.h
52     GeomAlgoAPI_ShapeTools.h
53     GeomAlgoAPI_Partition.h
54     GeomAlgoAPI_PaveFiller.h
55     GeomAlgoAPI_Intersection.h
56     GeomAlgoAPI_Pipe.h
57     GeomAlgoAPI_WireBuilder.h
58     GeomAlgoAPI_Sewing.h
59     GeomAlgoAPI_ShapeBuilder.h
60     GeomAlgoAPI_ShapeAPI.h
61     GeomAlgoAPI_Exception.h
62     GeomAlgoAPI_Box.h
63     GeomAlgoAPI_Cone.h
64     GeomAlgoAPI_Cylinder.h
65     GeomAlgoAPI_Sphere.h
66     GeomAlgoAPI_Torus.h
67     GeomAlgoAPI_XAOExport.h
68     GeomAlgoAPI_XAOImport.h
69     GeomAlgoAPI_Copy.h
70     GeomAlgoAPI_ConeSegment.h
71     GeomAlgoAPI_Ellipsoid.h
72     GeomAlgoAPI_Symmetry.h
73     GeomAlgoAPI_Scale.h
74     GeomAlgoAPI_Circ2dBuilder.h
75     GeomAlgoAPI_UnifySameDomain.h
76     GeomAlgoAPI_Fillet.h
77     GeomAlgoAPI_SortListOfShapes.h
78     GeomAlgoAPI_Filling.h
79     GeomAlgoAPI_CurveBuilder.h
80     GeomAlgoAPI_NExplode.h
81     GeomAlgoAPI_Offset.h
82     GeomAlgoAPI_SolidClassifier.h
83     GeomAlgoAPI_MapShapesAndAncestors.h
84     GeomAlgoAPI_Chamfer.h
85 )
86
87 SET(PROJECT_SOURCES
88     GeomAlgoAPI_Tools.cpp
89     GeomAlgoAPI_CompoundBuilder.cpp
90     GeomAlgoAPI_FaceBuilder.cpp
91     GeomAlgoAPI_EdgeBuilder.cpp
92     GeomAlgoAPI_PointBuilder.cpp
93     GeomAlgoAPI_SketchBuilder.cpp
94     GeomAlgoAPI_Prism.cpp
95     GeomAlgoAPI_Revolution.cpp
96     GeomAlgoAPI_Boolean.cpp
97     GeomAlgoAPI_Rotation.cpp
98     GeomAlgoAPI_Translation.cpp
99     GeomAlgoAPI_MakeShape.cpp
100     GeomAlgoAPI_MakeShapeCustom.cpp
101     GeomAlgoAPI_MakeShapeList.cpp
102     GeomAlgoAPI_MakeSweep.cpp
103     GeomAlgoAPI_MakeVolume.cpp
104     GeomAlgoAPI_DFLoader.cpp
105     GeomAlgoAPI_Placement.cpp
106     GeomAlgoAPI_BREPImport.cpp
107     GeomAlgoAPI_STEPImport.cpp
108     GeomAlgoAPI_IGESImport.cpp
109     GeomAlgoAPI_BREPExport.cpp
110     GeomAlgoAPI_STEPExport.cpp
111     GeomAlgoAPI_IGESExport.cpp
112     GeomAlgoAPI_Transform.cpp
113     GeomAlgoAPI_ShapeTools.cpp
114     GeomAlgoAPI_Partition.cpp
115     GeomAlgoAPI_PaveFiller.cpp
116     GeomAlgoAPI_Intersection.cpp
117     GeomAlgoAPI_Pipe.cpp
118     GeomAlgoAPI_WireBuilder.cpp
119     GeomAlgoAPI_Sewing.cpp
120     GeomAlgoAPI_ShapeBuilder.cpp
121     GeomAlgoAPI_ShapeAPI.cpp
122     GeomAlgoAPI_Exception.cpp
123     GeomAlgoAPI_Box.cpp
124     GeomAlgoAPI_Cone.cpp
125     GeomAlgoAPI_Cylinder.cpp
126     GeomAlgoAPI_Sphere.cpp
127     GeomAlgoAPI_Torus.cpp
128     GeomAlgoAPI_XAOExport.cpp
129     GeomAlgoAPI_XAOImport.cpp
130     GeomAlgoAPI_Copy.cpp
131     GeomAlgoAPI_ConeSegment.cpp
132     GeomAlgoAPI_Ellipsoid.cpp
133     GeomAlgoAPI_Symmetry.cpp
134     GeomAlgoAPI_Scale.cpp
135     GeomAlgoAPI_Circ2dBuilder.cpp
136     GeomAlgoAPI_UnifySameDomain.cpp
137     GeomAlgoAPI_Fillet.cpp
138     GeomAlgoAPI_SortListOfShapes.cpp
139     GeomAlgoAPI_Filling.cpp
140     GeomAlgoAPI_CurveBuilder.cpp
141     GeomAlgoAPI_NExplode.cpp
142     GeomAlgoAPI_Offset.cpp
143     GeomAlgoAPI_SolidClassifier.cpp
144     GeomAlgoAPI_MapShapesAndAncestors.cpp
145     GeomAlgoAPI_Projection.cpp
146     GeomAlgoAPI_Chamfer.cpp
147 )
148
149 SET(PROJECT_LIBRARIES
150     GeomAPI
151     GeomAlgoImpl
152     ModelAPI
153     XAOShaper
154     ${OpenCASCADE_DataExchange_LIBRARIES}
155     ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
156     ${OpenCASCADE_ApplicationFramework_LIBRARIES}
157 )
158
159 ADD_DEFINITIONS(-DGEOMALGOAPI_EXPORTS ${OpenCASCADE_DEFINITIONS})
160 ADD_LIBRARY(GeomAlgoAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
161
162 SET(CMAKE_SWIG_FLAGS -w325,321,362,383,302)
163
164 SET_SOURCE_FILES_PROPERTIES(GeomAlgoAPI.i PROPERTIES CPLUSPLUS ON)
165 SET_SOURCE_FILES_PROPERTIES(GeomAlgoAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
166
167 INCLUDE_DIRECTORIES(
168   ../GeomAPI
169   ../GeomAlgoImpl
170   ../ModelAPI
171   ../XAO
172   ${OpenCASCADE_INCLUDE_DIR}
173 )
174
175 TARGET_LINK_LIBRARIES(GeomAlgoAPI ${PROJECT_LIBRARIES})
176
177 SET(SWIG_SCRIPTS
178   ${CMAKE_CURRENT_BINARY_DIR}/GeomAlgoAPI.py
179 )
180
181 SET(SWIG_LINK_LIBRARIES
182   GeomAPI
183   GeomAlgoAPI
184   GeomAlgoImpl
185   ${PYTHON_LIBRARIES}
186 )
187
188 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
189   SWIG_ADD_LIBRARY(GeomAlgoAPI LANGUAGE python SOURCES GeomAlgoAPI.i ${PROJECT_HEADERS})
190 ELSE()
191   SWIG_ADD_MODULE(GeomAlgoAPI python GeomAlgoAPI.i ${PROJECT_HEADERS})
192 ENDIF()
193 SWIG_LINK_LIBRARIES(GeomAlgoAPI ${SWIG_LINK_LIBRARIES})
194
195 IF(WIN32)
196   SET_TARGET_PROPERTIES(_GeomAlgoAPI PROPERTIES DEBUG_OUTPUT_NAME _GeomAlgoAPI_d)
197 ENDIF(WIN32)
198
199 INSTALL(TARGETS _GeomAlgoAPI DESTINATION ${SHAPER_INSTALL_SWIG})
200 INSTALL(TARGETS GeomAlgoAPI DESTINATION ${SHAPER_INSTALL_BIN})
201 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
202