]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/CMakeLists.txt
Salome HOME
[bos #37570] [CEA] SHAPER hdf tests are failing. Fix Sphere feature attributes order.
[modules/shaper.git] / src / SketchPlugin / CMakeLists.txt
1 # Copyright (C) 2014-2023  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 INCLUDE(Common)
21 INCLUDE(UnitTest)
22
23 SET(PROJECT_HEADERS
24     SketchPlugin.h
25     SketchPlugin_Arc.h
26     SketchPlugin_BSpline.h
27     SketchPlugin_BSplineBase.h
28     SketchPlugin_BSplinePeriodic.h
29     SketchPlugin_Circle.h
30     SketchPlugin_Constraint.h
31     SketchPlugin_ConstraintAngle.h
32     SketchPlugin_ConstraintBase.h
33     SketchPlugin_ConstraintCoincidence.h
34     SketchPlugin_ConstraintCoincidenceInternal.h
35     SketchPlugin_ConstraintCollinear.h
36     SketchPlugin_ConstraintDistance.h
37     SketchPlugin_ConstraintDistanceAlongDir.h
38     SketchPlugin_ConstraintDistanceHorizontal.h
39     SketchPlugin_ConstraintDistanceVertical.h
40     SketchPlugin_ConstraintEqual.h
41     SketchPlugin_Fillet.h
42     SketchPlugin_ConstraintHorizontal.h
43     SketchPlugin_ConstraintLength.h
44     SketchPlugin_ConstraintMiddle.h
45     SketchPlugin_ConstraintMirror.h
46     SketchPlugin_ConstraintParallel.h
47     SketchPlugin_ConstraintPerpendicular.h
48     SketchPlugin_ConstraintRadius.h
49     SketchPlugin_ConstraintRigid.h
50     SketchPlugin_ConstraintTangent.h
51     SketchPlugin_ConstraintVertical.h
52     SketchPlugin_CurveFitting.h
53     SketchPlugin_Ellipse.h
54     SketchPlugin_EllipticArc.h
55     SketchPlugin_ExternalValidator.h
56     SketchPlugin_Feature.h
57     SketchPlugin_IntersectionPoint.h
58     SketchPlugin_Line.h
59     SketchPlugin_MacroArc.h
60     SketchPlugin_MacroArcReentrantMessage.h
61     SketchPlugin_MacroBSpline.h
62     SketchPlugin_MacroCircle.h
63     SketchPlugin_MacroEllipse.h
64     SketchPlugin_MacroEllipticArc.h
65     SketchPlugin_MultiRotation.h
66     SketchPlugin_MultiTranslation.h
67     SketchPlugin_Offset.h
68     SketchPlugin_OverConstraintsResolver.h
69     SketchPlugin_Plugin.h
70     SketchPlugin_Point.h
71     SketchPlugin_Projection.h
72     SketchPlugin_Sketch.h
73     SketchPlugin_SketchCopy.h
74     SketchPlugin_SketchDrawer.h
75     SketchPlugin_SketchEntity.h
76     SketchPlugin_Split.h
77     SketchPlugin_Tools.h
78     SketchPlugin_Trim.h
79     SketchPlugin_Validators.h
80 )
81
82 SET(PROJECT_SOURCES
83     SketchPlugin_Arc.cpp
84     SketchPlugin_BSpline.cpp
85     SketchPlugin_BSplineBase.cpp
86     SketchPlugin_BSplinePeriodic.cpp
87     SketchPlugin_Circle.cpp
88     SketchPlugin_Constraint.cpp
89     SketchPlugin_ConstraintAngle.cpp
90     SketchPlugin_ConstraintCoincidence.cpp
91     SketchPlugin_ConstraintCoincidenceInternal.cpp
92     SketchPlugin_ConstraintCollinear.cpp
93     SketchPlugin_ConstraintDistance.cpp
94     SketchPlugin_ConstraintDistanceAlongDir.cpp
95     SketchPlugin_ConstraintDistanceHorizontal.cpp
96     SketchPlugin_ConstraintDistanceVertical.cpp
97     SketchPlugin_ConstraintEqual.cpp
98     SketchPlugin_Fillet.cpp
99     SketchPlugin_ConstraintHorizontal.cpp
100     SketchPlugin_ConstraintLength.cpp
101     SketchPlugin_ConstraintMiddle.cpp
102     SketchPlugin_ConstraintMirror.cpp
103     SketchPlugin_ConstraintParallel.cpp
104     SketchPlugin_ConstraintPerpendicular.cpp
105     SketchPlugin_ConstraintRadius.cpp
106     SketchPlugin_ConstraintRigid.cpp
107     SketchPlugin_ConstraintTangent.cpp
108     SketchPlugin_ConstraintVertical.cpp
109     SketchPlugin_CurveFitting.cpp
110     SketchPlugin_Ellipse.cpp
111     SketchPlugin_EllipticArc.cpp
112     SketchPlugin_ExternalValidator.cpp
113     SketchPlugin_Feature.cpp
114     SketchPlugin_IntersectionPoint.cpp
115     SketchPlugin_Line.cpp
116     SketchPlugin_MacroArc.cpp
117     SketchPlugin_MacroBSpline.cpp
118     SketchPlugin_MacroCircle.cpp
119     SketchPlugin_MacroEllipse.cpp
120     SketchPlugin_MacroEllipticArc.cpp
121     SketchPlugin_MultiRotation.cpp
122     SketchPlugin_MultiTranslation.cpp
123     SketchPlugin_Offset.cpp
124     SketchPlugin_OverConstraintsResolver.cpp
125     SketchPlugin_Plugin.cpp
126     SketchPlugin_Point.cpp
127     SketchPlugin_Projection.cpp
128     SketchPlugin_Sketch.cpp
129     SketchPlugin_SketchCopy.cpp
130     SketchPlugin_SketchDrawer.cpp
131     SketchPlugin_SketchEntity.cpp
132     SketchPlugin_Split.cpp
133     SketchPlugin_Tools.cpp
134     SketchPlugin_Trim.cpp
135     SketchPlugin_Validators.cpp
136 )
137
138 SET(PROJECT_LIBRARIES
139     Config
140     GeomAPI
141     GeomAlgoAPI
142     GeomDataAPI
143     Locale
144     ModelAPI
145     ModelGeomAlgo
146     ModuleBase
147     SketcherPrs
148 )
149
150 SET(XML_RESOURCES
151   plugin-Sketch.xml
152   plugin-SketchCopy.xml
153   plugin-SketchDrawer.xml
154 )
155
156 SET(TEXT_RESOURCES
157     SketchPlugin_msg_en.ts
158     SketchPlugin_msg_fr.ts
159 )
160
161 SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC})
162 SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
163 SOURCE_GROUP ("XML Files" FILES ${XML_RESOURCES})
164
165 ADD_DEFINITIONS(-DSKETCHPLUGIN_EXPORTS)
166 ADD_LIBRARY(SketchPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES})
167 TARGET_LINK_LIBRARIES(SketchPlugin ${PROJECT_LIBRARIES})
168
169 INCLUDE_DIRECTORIES(
170   ../Config
171   ../Events
172   ../Locale
173   ../ModelAPI
174   ../ModelGeomAlgo
175   ../ModuleBase
176   ../GeomAPI
177   ../GeomAlgoAPI
178   ../GeomDataAPI
179   ../SketcherPrs
180 )
181
182 INSTALL(TARGETS SketchPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
183 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
184 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Sketch)
185 INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
186
187 include(tests.set)
188
189 ADD_UNIT_TESTS(${TEST_NAMES})
190
191 include(tests.set)
192
193 if(${SKETCHER_CHANGE_RADIUS_WHEN_MOVE})
194   include(tests_change_radius.set)
195   ADD_UNIT_TESTS(${TEST_NAMES_CHANGE_RADIUS})
196 endif()
197
198 ADD_RESTRICTED_TESTS(
199   Test20204.py
200 )
201
202 if(${HAVE_SALOME})
203   enable_testing()
204   set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/SketchPlugin")
205   
206   install(FILES CTestTestfileInstall.cmake
207   DESTINATION ${TEST_INSTALL_DIRECTORY}
208   RENAME CTestTestfile.cmake)
209   if(${SKETCHER_CHANGE_RADIUS_WHEN_MOVE})
210     set(TEST_NAMES ${TEST_NAMES} ${TEST_NAMES_CHANGE_RADIUS})
211     install(FILES tests_change_radius.set DESTINATION ${TEST_INSTALL_DIRECTORY})
212   endif()
213   install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
214   
215   set(TMP_TESTS_NAMES)
216   foreach(tfile ${TEST_NAMES})
217     list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
218   endforeach(tfile ${TEST_NAMES})
219   
220   install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
221 endif(${HAVE_SALOME})