Salome HOME
198f7d82f4a9f1012a86ef45a21f7ec53e80371b
[modules/shaper.git] / src / FeaturesPlugin / 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 INCLUDE(UnitTest)
22
23
24 SET(PROJECT_HEADERS
25     FeaturesPlugin.h
26     FeaturesPlugin_Plugin.h
27     FeaturesPlugin_Extrusion.h
28     FeaturesPlugin_Recover.h
29     FeaturesPlugin_Revolution.h
30     FeaturesPlugin_Rotation.h
31     FeaturesPlugin_Translation.h
32     FeaturesPlugin_VersionedBoolean.h
33     FeaturesPlugin_Boolean.h
34     FeaturesPlugin_BooleanCut.h
35     FeaturesPlugin_BooleanFuse.h
36     FeaturesPlugin_BooleanCommon.h
37     FeaturesPlugin_BooleanSmash.h
38     FeaturesPlugin_BooleanFill.h
39     FeaturesPlugin_Intersection.h
40     FeaturesPlugin_Partition.h
41     FeaturesPlugin_Pipe.h
42     FeaturesPlugin_Loft.h
43     FeaturesPlugin_Placement.h
44     FeaturesPlugin_PointCloudOnFace.h
45     FeaturesPlugin_CompositeBoolean.h
46     FeaturesPlugin_CompositeSketch.h
47     FeaturesPlugin_ExtrusionBoolean.h
48     FeaturesPlugin_ExtrusionCut.h
49     FeaturesPlugin_ExtrusionFuse.h
50     FeaturesPlugin_RevolutionBoolean.h
51     FeaturesPlugin_RevolutionCut.h
52     FeaturesPlugin_RevolutionFuse.h
53     FeaturesPlugin_Union.h
54     FeaturesPlugin_ValidatorTransform.h
55     FeaturesPlugin_Validators.h
56     FeaturesPlugin_RemoveSubShapes.h
57     FeaturesPlugin_Tools.h
58     FeaturesPlugin_Symmetry.h
59     FeaturesPlugin_Scale.h
60     FeaturesPlugin_Sewing.h
61     FeaturesPlugin_MultiTranslation.h
62     FeaturesPlugin_MultiRotation.h
63     FeaturesPlugin_Fillet.h
64     FeaturesPlugin_Fillet1D.h
65     FeaturesPlugin_Measurement.h
66     FeaturesPlugin_FusionFaces.h
67     FeaturesPlugin_RemoveResults.h
68     FeaturesPlugin_Chamfer.h
69     FeaturesPlugin_Copy.h
70     FeaturesPlugin_ImportResult.h
71     FeaturesPlugin_Defeaturing.h
72     FeaturesPlugin_VersionedChFi.h
73     FeaturesPlugin_PointCoordinates.h
74     FeaturesPlugin_GeometryCalculation.h
75     FeaturesPlugin_BoundingBox.h
76     FeaturesPlugin_BoundingBoxBase.h
77     FeaturesPlugin_InspectBoundingBox.h
78     FeaturesPlugin_NormalToFace.h
79     FeaturesPlugin_InspectNormalToFace.h
80     FeaturesPlugin_GlueFaces.h
81     FeaturesPlugin_LimitTolerance.h
82     FeaturesPlugin_CommonSharedFaces.h
83     FeaturesPlugin_GroupSharedFaces.h
84     FeaturesPlugin_SharedFaces.h
85 )
86
87 SET(PROJECT_SOURCES
88     FeaturesPlugin_Plugin.cpp
89     FeaturesPlugin_Extrusion.cpp
90     FeaturesPlugin_Recover.cpp
91     FeaturesPlugin_Revolution.cpp
92     FeaturesPlugin_Rotation.cpp
93     FeaturesPlugin_Translation.cpp
94     FeaturesPlugin_VersionedBoolean.cpp
95     FeaturesPlugin_Boolean.cpp
96     FeaturesPlugin_BooleanCut.cpp
97     FeaturesPlugin_BooleanFuse.cpp
98     FeaturesPlugin_BooleanCommon.cpp
99     FeaturesPlugin_BooleanSmash.cpp
100     FeaturesPlugin_BooleanFill.cpp
101     FeaturesPlugin_Intersection.cpp
102     FeaturesPlugin_Partition.cpp
103     FeaturesPlugin_Pipe.cpp
104     FeaturesPlugin_Loft.cpp
105     FeaturesPlugin_Placement.cpp
106     FeaturesPlugin_PointCloudOnFace.cpp
107     FeaturesPlugin_CompositeBoolean.cpp
108     FeaturesPlugin_CompositeSketch.cpp
109     FeaturesPlugin_ExtrusionBoolean.cpp
110     FeaturesPlugin_ExtrusionCut.cpp
111     FeaturesPlugin_ExtrusionFuse.cpp
112     FeaturesPlugin_RevolutionBoolean.cpp
113     FeaturesPlugin_RevolutionCut.cpp
114     FeaturesPlugin_RevolutionFuse.cpp
115     FeaturesPlugin_Union.cpp
116     FeaturesPlugin_ValidatorTransform.cpp
117     FeaturesPlugin_Validators.cpp
118     FeaturesPlugin_RemoveSubShapes.cpp
119     FeaturesPlugin_Tools.cpp
120     FeaturesPlugin_Symmetry.cpp
121     FeaturesPlugin_Scale.cpp
122     FeaturesPlugin_Sewing.cpp
123     FeaturesPlugin_MultiTranslation.cpp
124     FeaturesPlugin_MultiRotation.cpp
125     FeaturesPlugin_Fillet.cpp
126     FeaturesPlugin_Fillet1D.cpp
127     FeaturesPlugin_Measurement.cpp
128     FeaturesPlugin_FusionFaces.cpp
129     FeaturesPlugin_RemoveResults.cpp
130     FeaturesPlugin_Chamfer.cpp
131     FeaturesPlugin_Copy.cpp
132     FeaturesPlugin_ImportResult.cpp
133     FeaturesPlugin_Defeaturing.cpp
134     FeaturesPlugin_VersionedChFi.cpp
135     FeaturesPlugin_PointCoordinates.cpp
136     FeaturesPlugin_GeometryCalculation.cpp
137     FeaturesPlugin_BoundingBox.cpp
138     FeaturesPlugin_BoundingBoxBase.cpp
139     FeaturesPlugin_InspectBoundingBox.cpp
140     FeaturesPlugin_NormalToFace.cpp
141     FeaturesPlugin_InspectNormalToFace.cpp
142     FeaturesPlugin_GlueFaces.cpp
143     FeaturesPlugin_LimitTolerance.cpp
144     FeaturesPlugin_CommonSharedFaces.cpp
145     FeaturesPlugin_GroupSharedFaces.cpp
146     FeaturesPlugin_SharedFaces.cpp
147 )
148
149 SET(XML_RESOURCES
150   plugin-Features.xml
151   extrusion_widget.xml
152   extrusioncut_widget.xml
153   extrusionfuse_widget.xml
154   revolution_widget.xml
155   revolutioncut_widget.xml
156   revolutionfuse_widget.xml
157   rotation_widget.xml
158   translation_widget.xml
159   boolean_widget.xml
160   boolean_fuse_widget.xml
161   boolean_common_widget.xml
162   boolean_split_widget.xml
163   boolean_smash_widget.xml
164   recover_widget.xml
165   partition_widget.xml
166   placement_widget.xml
167   intersection_widget.xml
168   pipe_widget.xml
169   loft_widget.xml
170   remove_subshapes_widget.xml
171   union_widget.xml
172   symmetry_widget.xml
173   scale_widget.xml
174   sewing_widget.xml
175   multitranslation_widget.xml
176   multirotation_widget.xml
177   fillet_widget.xml
178   fillet1d_widget.xml
179   measurement_widget.xml
180   fusion_faces_widget.xml
181   glue_faces_widget.xml
182   chamfer_widget.xml
183   copy_widget.xml
184   import_result_widget.xml
185   defeaturing_widget.xml
186   point_coordinates_widget.xml
187   geometry_calculation_widget.xml
188   bounding_box_widget.xml
189   create_bounding_box_widget.xml
190   normal_to_face_widget.xml
191   create_normal_to_face_widget.xml
192   limit_tolerance_widget.xml
193   shared_faces_macro_widget.xml
194   shared_faces_widget.xml
195 )
196
197 SET(TEXT_RESOURCES
198     FeaturesPlugin_msg_en.ts
199     FeaturesPlugin_msg_fr.ts
200     FeaturesPlugin_msg_ru.ts
201 )
202
203 SOURCE_GROUP ("XML Files" FILES ${XML_RESOURCES})
204 SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
205
206
207 INCLUDE_DIRECTORIES(
208   ../ModelAPI
209   ../GeomAPI
210   ../GeomAlgoAPI
211   ../GeomValidators
212   ../ModuleBase
213   ../Events
214   ../Config
215   ../Locale
216   ${OpenCASCADE_INCLUDE_DIR}
217 )
218
219 SET(PROJECT_LIBRARIES
220     Events
221     ModelAPI
222     GeomAPI
223     GeomAlgoAPI
224     GeomValidators
225     Config
226     ${OpenCASCADE_Visualization_LIBRARIES}
227 )
228
229 ADD_DEFINITIONS(-DFEATURESPLUGIN_EXPORTS)
230 ADD_LIBRARY(FeaturesPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES})
231 TARGET_LINK_LIBRARIES(FeaturesPlugin ${PROJECT_LIBRARIES})
232
233 INSTALL(TARGETS FeaturesPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
234 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
235 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Features)
236 INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
237
238 INCLUDE(tests.set)
239
240 ADD_UNIT_TESTS(
241   ${TEST_NAMES}
242 )
243
244 IF(${HAVE_SALOME})
245   enable_testing()
246   set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/FeaturesPlugin")
247
248   install(FILES CTestTestfileInstall.cmake
249   DESTINATION ${TEST_INSTALL_DIRECTORY}
250   RENAME CTestTestfile.cmake)
251   install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
252
253   set(TMP_TESTS_NAMES)
254   foreach(tfile ${TEST_NAMES})
255     list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
256   endforeach(tfile ${TEST_NAMES})
257
258   install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
259   install(DIRECTORY data DESTINATION ${TEST_INSTALL_DIRECTORY})
260 ENDIF(${HAVE_SALOME})