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