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