1 ## Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
22 INCLUDE(XMLProcessing)
23 FIND_PACKAGE(SWIG REQUIRED)
24 INCLUDE(${SWIG_USE_FILE})
26 INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events
27 ${PYTHON_INCLUDE_DIR})
31 Config_FeatureMessage.h
32 Config_PluginMessage.h
35 Config_FeatureReader.h
39 Config_PointerMessage.h
41 Config_ValidatorMessage.h
44 Config_AttributeMessage.h
45 Config_ValidatorReader.h
46 Config_DataModelReader.h
51 Config_FeatureMessage.cpp
52 Config_PluginMessage.cpp
54 Config_ModuleReader.cpp
55 Config_FeatureReader.cpp
57 Config_WidgetReader.cpp
58 Config_PointerMessage.cpp
60 Config_ValidatorMessage.cpp
62 Config_PropManager.cpp
63 Config_AttributeMessage.cpp
64 Config_ValidatorReader.cpp
65 Config_DataModelReader.cpp
69 SET(CMAKE_SWIG_FLAGS -threads -Wall)
70 SET_SOURCE_FILES_PROPERTIES(ConfigAPI.i PROPERTIES CPLUSPLUS ON)
71 SET_SOURCE_FILES_PROPERTIES(ConfigAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
73 ${CMAKE_CURRENT_BINARY_DIR}/ConfigAPI.py
75 SET(SWIG_LINK_LIBRARIES
79 SWIG_ADD_MODULE(ConfigAPI python ConfigAPI.i ${PROJECT_HEADERS})
80 SWIG_LINK_LIBRARIES(ConfigAPI ${SWIG_LINK_LIBRARIES})
82 SET_TARGET_PROPERTIES(_ConfigAPI PROPERTIES DEBUG_OUTPUT_NAME _ConfigAPI_d)
87 ${CMAKE_CURRENT_BINARY_DIR}/plugins.xml
97 SOURCE_GROUP ("Resource Files" FILES ${XML_RESOURCES})
99 ADD_DEFINITIONS(-DCONFIG_EXPORTS -D_SCL_SECURE_NO_WARNINGS)
100 # -D_SCL_SECURE_NO_WARNINGS - to disable warnings 4996
102 ADD_LIBRARY(Config SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES})
104 TARGET_LINK_LIBRARIES(Config ${PROJECT_LIBRARIES})
106 # Prepare plugins.xml
108 # the solver to activate after installation
109 SET(DEFAULT_SOLVER "PlaneGCS")
111 # the list of all solvers
112 SET(SOLVERS "SolveSpace" "PlaneGCS")
114 # apply NO_<solver> variables
115 FOREACH(solver IN LISTS SOLVERS)
117 LIST(REMOVE_ITEM SOLVERS ${solver})
121 # check default solver in the list of solvers
122 LIST(FIND SOLVERS ${DEFAULT_SOLVER} INDEX)
123 IF(${INDEX} GREATER -1)
124 MESSAGE(STATUS "Default solver: ${DEFAULT_SOLVER}")
126 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}.")
129 # prepare variables for configuration
130 SET(DEFAULT_SOLVER " <plugin library=\"${DEFAULT_SOLVER}Solver\"/>")
131 FOREACH(solver IN LISTS SOLVERS)
132 IF(DEFINED ALL_SOLVERS)
133 SET(ALL_SOLVERS "${ALL_SOLVERS}\n")
135 SET(ALL_SOLVERS "${ALL_SOLVERS} <plugin library=\"${solver}Solver\"/>")
140 "${CMAKE_CURRENT_SOURCE_DIR}/plugins.xml.in"
141 "${CMAKE_CURRENT_BINARY_DIR}/plugins.xml"
144 INSTALL(TARGETS Config DESTINATION ${SHAPER_INSTALL_BIN})
145 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
147 INSTALL(TARGETS _ConfigAPI DESTINATION ${SHAPER_INSTALL_SWIG})
148 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})