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
34 Config_FeatureReader.h
38 Config_PointerMessage.h
40 Config_ValidatorMessage.h
43 Config_AttributeMessage.h
44 Config_ValidatorReader.h
45 Config_DataModelReader.h
50 Config_FeatureMessage.cpp
52 Config_ModuleReader.cpp
53 Config_FeatureReader.cpp
55 Config_WidgetReader.cpp
56 Config_PointerMessage.cpp
58 Config_ValidatorMessage.cpp
60 Config_PropManager.cpp
61 Config_AttributeMessage.cpp
62 Config_ValidatorReader.cpp
63 Config_DataModelReader.cpp
67 SET(CMAKE_SWIG_FLAGS -threads -Wall)
68 SET_SOURCE_FILES_PROPERTIES(ConfigAPI.i PROPERTIES CPLUSPLUS ON)
69 SET_SOURCE_FILES_PROPERTIES(ConfigAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
71 ${CMAKE_CURRENT_BINARY_DIR}/ConfigAPI.py
73 SET(SWIG_LINK_LIBRARIES
77 SWIG_ADD_MODULE(ConfigAPI python ConfigAPI.i ${PROJECT_HEADERS})
78 SWIG_LINK_LIBRARIES(ConfigAPI ${SWIG_LINK_LIBRARIES})
80 SET_TARGET_PROPERTIES(_ConfigAPI PROPERTIES DEBUG_OUTPUT_NAME _ConfigAPI_d)
85 ${CMAKE_CURRENT_BINARY_DIR}/plugins.xml
95 SOURCE_GROUP ("Resource Files" FILES ${XML_RESOURCES})
97 ADD_DEFINITIONS(-DCONFIG_EXPORTS -D_SCL_SECURE_NO_WARNINGS)
98 # -D_SCL_SECURE_NO_WARNINGS - to disable warnings 4996
100 ADD_LIBRARY(Config SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES})
102 TARGET_LINK_LIBRARIES(Config ${PROJECT_LIBRARIES})
104 # Prepare plugins.xml
106 # the solver to activate after installation
107 SET(DEFAULT_SOLVER "PlaneGCS")
109 # the list of all solvers
110 SET(SOLVERS "SolveSpace" "PlaneGCS")
112 # apply NO_<solver> variables
113 FOREACH(solver IN LISTS SOLVERS)
115 LIST(REMOVE_ITEM SOLVERS ${solver})
119 # check default solver in the list of solvers
120 LIST(FIND SOLVERS ${DEFAULT_SOLVER} INDEX)
121 IF(${INDEX} GREATER -1)
122 MESSAGE(STATUS "Default solver: ${DEFAULT_SOLVER}")
124 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}.")
127 # prepare variables for configuration
128 SET(DEFAULT_SOLVER " <plugin library=\"${DEFAULT_SOLVER}Solver\"/>")
129 FOREACH(solver IN LISTS SOLVERS)
130 IF(DEFINED ALL_SOLVERS)
131 SET(ALL_SOLVERS "${ALL_SOLVERS}\n")
133 SET(ALL_SOLVERS "${ALL_SOLVERS} <plugin library=\"${solver}Solver\"/>")
138 "${CMAKE_CURRENT_SOURCE_DIR}/plugins.xml.in"
139 "${CMAKE_CURRENT_BINARY_DIR}/plugins.xml"
142 INSTALL(TARGETS Config DESTINATION ${SHAPER_INSTALL_BIN})
143 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
145 INSTALL(TARGETS _ConfigAPI DESTINATION ${SHAPER_INSTALL_SWIG})
146 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})