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