Salome HOME
Copyright update 2022
[modules/shaper.git] / src / ConstructionPlugin / 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     ConstructionPlugin.h
25     ConstructionPlugin_Plugin.h
26     ConstructionPlugin_Point.h
27     ConstructionPlugin_Axis.h
28     ConstructionPlugin_Plane.h
29     ConstructionPlugin_Validators.h
30 )
31
32 SET(PROJECT_SOURCES
33     ConstructionPlugin_Plugin.cpp
34     ConstructionPlugin_Point.cpp
35     ConstructionPlugin_Axis.cpp
36     ConstructionPlugin_Plane.cpp
37     ConstructionPlugin_Validators.cpp
38 )
39
40 SET(XML_RESOURCES
41   plugin-Construction.xml
42   point_widget.xml
43   axis_widget.xml
44   plane_widget.xml
45 )
46
47 SET(TEXT_RESOURCES
48   ConstructionPlugin_msg_en.ts
49   ConstructionPlugin_msg_fr.ts
50 )
51
52 SET(PROJECT_LIBRARIES
53     Config
54     ModelAPI
55     GeomAPI
56     GeomAlgoAPI
57     GeomDataAPI
58 )
59
60 SOURCE_GROUP ("XML Files" FILES ${XML_RESOURCES})
61 SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
62
63 ADD_DEFINITIONS(-DCONSTRUCTIONPLUGIN_EXPORTS)
64 ADD_LIBRARY(ConstructionPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES})
65 TARGET_LINK_LIBRARIES(ConstructionPlugin ${PROJECT_LIBRARIES})
66
67 INSTALL(TARGETS ConstructionPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
68 INSTALL(FILES ${XML_RESOURCES} ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
69 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Construction)
70
71 INCLUDE_DIRECTORIES(
72   ../Config
73   ../ModelAPI
74   ../GeomAPI
75   ../GeomAlgoAPI
76   ../Events
77   ../GeomDataAPI
78 )
79
80 include(tests.set)
81
82 ADD_UNIT_TESTS(${TEST_NAMES})
83
84 if(${HAVE_SALOME})
85   enable_testing()
86   set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/ConstructionPlugin")
87   
88   install(FILES CTestTestfileInstall.cmake
89   DESTINATION ${TEST_INSTALL_DIRECTORY}
90   RENAME CTestTestfile.cmake)
91   install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
92   
93   set(TMP_TESTS_NAMES)
94   foreach(tfile ${TEST_NAMES})
95     list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
96   endforeach(tfile ${TEST_NAMES})
97   
98   install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
99 endif(${HAVE_SALOME})