Salome HOME
a3938251a06a245b8431031598c81c77579c962a
[modules/shaper.git] / src / FiltersPlugin / 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     FiltersPlugin.h
25     FiltersPlugin_Plugin.h
26     FiltersPlugin_Selection.h
27     FiltersPlugin_HorizontalFace.h
28     FiltersPlugin_VerticalFace.h
29     FiltersPlugin_BelongsTo.h
30     FiltersPlugin_OnPlane.h
31     FiltersPlugin_OnLine.h
32     FiltersPlugin_OnGeometry.h
33     FiltersPlugin_OnPlaneSide.h
34     FiltersPlugin_OnShapeName.h
35     FiltersPlugin_OppositeToEdge.h
36     FiltersPlugin_RelativeToSolid.h
37     FiltersPlugin_ExternalFaces.h
38     FiltersPlugin_Validators.h
39     FiltersPlugin_EdgeSize.h
40     FiltersPlugin_FaceSize.h
41     FiltersPlugin_VolumeSize.h
42     FiltersPlugin_FeatureEdges.h
43     FiltersPlugin_ContinuousFaces.h
44 )
45
46 SET(PROJECT_SOURCES
47     FiltersPlugin_Plugin.cpp
48     FiltersPlugin_Selection.cpp
49     FiltersPlugin_HorizontalFace.cpp
50     FiltersPlugin_VerticalFace.cpp
51     FiltersPlugin_BelongsTo.cpp
52     FiltersPlugin_OnPlane.cpp
53     FiltersPlugin_OnLine.cpp
54     FiltersPlugin_OnGeometry.cpp
55     FiltersPlugin_OnPlaneSide.cpp
56     FiltersPlugin_OnShapeName.cpp
57     FiltersPlugin_OppositeToEdge.cpp
58     FiltersPlugin_RelativeToSolid.cpp
59     FiltersPlugin_ExternalFaces.cpp
60     FiltersPlugin_Validators.cpp
61     FiltersPlugin_EdgeSize.cpp
62     FiltersPlugin_FaceSize.cpp
63     FiltersPlugin_VolumeSize.cpp
64     FiltersPlugin_FeatureEdges.cpp
65     FiltersPlugin_ContinuousFaces.cpp
66 )
67
68 SET(PROJECT_LIBRARIES
69     ModelAPI
70     Events
71     Config
72     GeomAPI
73     GeomAlgoAPI
74     GeomValidators
75 )
76
77 SET(PROJECT_PYFILES
78     FiltersPlugin_TopoConnectedFaces.py
79 )
80
81 SET(XML_RESOURCES
82   plugin-Filters.xml
83   filter-BelongsTo.xml
84   filter-OnGeometry.xml
85   filter-OnLine.xml
86   filter-OnPlane.xml
87   filter-OnPlaneSide.xml
88   filter-OnShapeName.xml
89   filter-OppositeToEdge.xml
90   filter-RelativeToSolid.xml
91   filter-TopoConnectedFaces.xml
92   filter-EdgeSize.xml
93   filter-FaceSize.xml
94   filter-VolumeSize.xml
95   filter-FeatureEdges.xml
96   filter-ContinuousFaces.xml
97 )
98
99 SET(TEXT_RESOURCES
100     FiltersPlugin_msg_en.ts
101     FiltersPlugin_msg_fr.ts
102 )
103
104 SOURCE_GROUP ("XML Files" FILES ${XML_RESOURCES})
105 SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
106
107 ADD_DEFINITIONS(-DFILTERS_EXPORTS ${OpenCASCADE_DEFINITIONS} ${BOOST_DEFINITIONS})
108 ADD_LIBRARY(FiltersPlugin SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES})
109 TARGET_LINK_LIBRARIES(FiltersPlugin ${PROJECT_LIBRARIES})
110
111 INCLUDE_DIRECTORIES(
112   ${OpenCASCADE_INCLUDE_DIR}
113   ${Boost_INCLUDE_DIRS}
114   ${PROJECT_SOURCE_DIR}/src/ModelAPI
115   ${PROJECT_SOURCE_DIR}/src/Config
116   ${PROJECT_SOURCE_DIR}/src/Events
117   ${PROJECT_SOURCE_DIR}/src/GeomAPI
118   ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
119   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
120   ${PROJECT_SOURCE_DIR}/src/GeomValidators
121   ${PROJECT_SOURCE_DIR}/src/CollectionPlugin
122   ${PROJECT_SOURCE_DIR}/src/Locale
123 )
124
125 INSTALL(TARGETS FiltersPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
126 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
127 INSTALL(FILES ${PROJECT_PYFILES} DESTINATION ${SHAPER_INSTALL_ADDONS})
128 INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
129
130 include(tests.set)
131
132 ADD_UNIT_TESTS(${TEST_NAMES})
133
134 if(${HAVE_SALOME})
135   enable_testing()
136   set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/FiltersPlugin")
137
138   install(FILES CTestTestfileInstall.cmake
139   DESTINATION ${TEST_INSTALL_DIRECTORY}
140   RENAME CTestTestfile.cmake)
141   install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
142
143   set(TMP_TESTS_NAMES)
144   foreach(tfile ${TEST_NAMES})
145     list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
146   endforeach(tfile ${TEST_NAMES})
147
148   install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
149 endif(${HAVE_SALOME})