Salome HOME
Wrong case correction: start translation, select compsolid, activate value control...
[modules/shaper.git] / src / Config / CMakeLists.txt
1 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 INCLUDE(Common)
4 INCLUDE(XMLProcessing)
5
6 INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events
7                      ${PYTHON_INCLUDE_DIR})
8
9 SET(PROJECT_HEADERS
10   Config_def.h
11   Config_FeatureMessage.h
12   Config_XMLReader.h
13   Config_ModuleReader.h
14   Config_FeatureReader.h
15   Config_Keywords.h
16   Config_WidgetAPI.h
17   Config_WidgetReader.h
18   Config_PointerMessage.h
19   Config_Common.h
20   Config_ValidatorMessage.h
21   Config_Prop.h
22   Config_PropManager.h
23   Config_AttributeMessage.h
24   Config_SelectionFilterMessage.h
25   Config_ValidatorReader.h
26   Config_DataModelReader.h
27  )
28
29 SET(PROJECT_SOURCES
30   Config_FeatureMessage.cpp
31   Config_XMLReader.cpp
32   Config_ModuleReader.cpp
33   Config_FeatureReader.cpp
34   Config_WidgetAPI.cpp
35   Config_WidgetReader.cpp
36   Config_PointerMessage.cpp
37   Config_Common.cpp
38   Config_ValidatorMessage.cpp
39   Config_Prop.cpp
40   Config_PropManager.cpp
41   Config_AttributeMessage.cpp
42   Config_SelectionFilterMessage.cpp
43   Config_ValidatorReader.cpp
44   Config_DataModelReader.cpp
45 )
46
47 SET(XML_RESOURCES
48   ${CMAKE_CURRENT_BINARY_DIR}/plugins.xml
49   dataModel.xml
50 )
51
52 SET(PROJECT_LIBRARIES
53     Events
54     ${LIBXML2_LIBRARIES}
55     ${PYTHON_LIBRARIES}
56 )
57
58 SOURCE_GROUP ("Resource Files" FILES ${XML_RESOURCES})
59
60 ADD_DEFINITIONS(-DCONFIG_EXPORTS -D_SCL_SECURE_NO_WARNINGS)
61 # -D_SCL_SECURE_NO_WARNINGS - to disable warnings 4996
62
63 ADD_LIBRARY(Config SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES})
64
65 TARGET_LINK_LIBRARIES(Config ${PROJECT_LIBRARIES})
66
67 # Prepare plugins.xml
68
69 # the solver to activate after installation
70 SET(DEFAULT_SOLVER "SolveSpace")
71
72 # the list of all solvers
73 SET(SOLVERS "SolveSpace" "PlaneGCS")
74
75 # apply NO_<solver> variables
76 FOREACH(solver IN LISTS SOLVERS)
77   IF(NO_${solver})
78     LIST(REMOVE_ITEM SOLVERS ${solver})
79   ENDIF()
80 ENDFOREACH()
81
82 # check default solver in the list of solvers
83 LIST(FIND SOLVERS ${DEFAULT_SOLVER} INDEX)
84 IF(${INDEX} GREATER -1)
85   MESSAGE(STATUS "Default solver: ${DEFAULT_SOLVER}")
86 ELSE()
87   MESSAGE(FATAL_ERROR "Default solver: ${DEFAULT_SOLVER} is switched off.\nUnset NO_${DEFAULT_SOLVER} variable or define another default solver DEFAULT_SOLVER=<SOLVER> from the list: ${SOLVERS}.")
88 ENDIF()
89
90 # prepare variables for configuration
91 SET(DEFAULT_SOLVER "  <plugin library=\"${DEFAULT_SOLVER}Solver\"/>")
92 FOREACH(solver IN LISTS SOLVERS)
93   IF(DEFINED ALL_SOLVERS)
94     SET(ALL_SOLVERS "${ALL_SOLVERS}\n")
95   ENDIF()
96   SET(ALL_SOLVERS "${ALL_SOLVERS}  <plugin library=\"${solver}Solver\"/>")
97 ENDFOREACH()
98
99 # configuration
100 CONFIGURE_FILE(
101   "${CMAKE_CURRENT_SOURCE_DIR}/plugins.xml.in"
102   "${CMAKE_CURRENT_BINARY_DIR}/plugins.xml"
103   )
104
105 INSTALL(TARGETS Config DESTINATION ${SHAPER_INSTALL_BIN})
106 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})