]> SALOME platform Git repositories - modules/shaper.git/blob - CMakeLists.txt
Salome HOME
4b2fae4d89b9ecec7c4cfbf854eef349cd1ee825
[modules/shaper.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
2
3 PROJECT (SHAPER)
4 SET (SHAPER_Version 2.3.1)
5
6 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
7
8 INCLUDE(FindEclipse)
9 INCLUDE(Common)
10 INCLUDE(FindQt)
11 INCLUDE(FindPython)
12 INCLUDE(FindSalome)
13 INCLUDE(FindCAS)
14 INCLUDE(FindSUIT)
15
16 # It could be called only once
17 FIND_PACKAGE(LibXml2 REQUIRED)
18
19 IF(UNIX)
20   IF(CMAKE_COMPILER_IS_GNUCC)
21     #C++11 is not supported on some platforms, disable it
22     MESSAGE(STATUS "Setting -std=c++0x flag for the gcc...")
23     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
24
25     #Supporting test coverage checks (gcov) in the DEBUG mode
26     IF(USE_TEST_COVERAGE)
27       INCLUDE(CodeCoverage)
28       MESSAGE(STATUS "Setting flags for gcov support the gcc...")
29       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
30       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
31       SET(CMAKE_SHARED_LINKER_FLAGS "-lgcov")
32
33       SETUP_TARGET_FOR_COVERAGE(test_coverage  # Name for custom target.
34                                 ctest          # Name of the test driver executable that runs the tests.
35                                 coverage)      # Name of output directory.
36     ENDIF(USE_TEST_COVERAGE)
37
38     #SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -E")
39     MESSAGE(STATUS "gcc flags are: " ${CMAKE_CXX_FLAGS})
40     MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS})
41   ENDIF(CMAKE_COMPILER_IS_GNUCC)
42 ENDIF(UNIX)
43
44 IF(${HAVE_SALOME})
45     SET(SHAPER_INSTALL_ADDONS bin/salome CACHE INTERNAL "" FORCE)
46     SET(SHAPER_INSTALL_BIN lib/salome CACHE INTERNAL "" FORCE)
47     SET(SHAPER_INSTALL_PLUGIN_FILES lib/salome CACHE INTERNAL "" FORCE)
48     SET(SHAPER_INSTALL_PYTHON_API bin/salome CACHE INTERNAL "" FORCE)
49     SET(SHAPER_INSTALL_PYTHON_FILES bin/salome CACHE INTERNAL "" FORCE)
50     SET(SHAPER_INSTALL_RESOURCES share/salome/resources/shaper CACHE INTERNAL "" FORCE)
51     SET(SHAPER_INSTALL_SWIG bin/salome CACHE INTERNAL "" FORCE)
52     SET(SHAPER_INSTALL_QM_RESOURCES share/salome/resources/shaper CACHE INTERNAL "" FORCE)
53     SET(SHAPER_INSTALL_XML_RESOURCES share/salome/resources/shaper CACHE INTERNAL "" FORCE)
54     SET(SHAPER_INSTALL_GUI_DOC share/doc/salome/gui/SHAPER CACHE INTERNAL "" FORCE)
55     SET(SHAPER_INSTALL_TUI_DOC share/doc/salome/tui/SHAPER CACHE INTERNAL "" FORCE)
56 ELSE(${HAVE_SALOME})
57     SET(SHAPER_INSTALL_ADDONS addons CACHE INTERNAL "" FORCE)
58     SET(SHAPER_INSTALL_BIN bin CACHE INTERNAL "" FORCE)
59     SET(SHAPER_INSTALL_PLUGIN_FILES plugins CACHE INTERNAL "" FORCE)
60     SET(SHAPER_INSTALL_PYTHON_API PythonAPI CACHE INTERNAL "" FORCE)
61     SET(SHAPER_INSTALL_PYTHON_FILES plugins CACHE INTERNAL "" FORCE)
62     SET(SHAPER_INSTALL_RESOURCES resources CACHE INTERNAL "" FORCE)
63     SET(SHAPER_INSTALL_SWIG swig CACHE INTERNAL "" FORCE)
64     SET(SHAPER_INSTALL_QM_RESOURCES bin CACHE INTERNAL "" FORCE)
65     SET(SHAPER_INSTALL_XML_RESOURCES plugins CACHE INTERNAL "" FORCE)
66     SET(SHAPER_INSTALL_GUI_DOC doc CACHE INTERNAL "" FORCE)
67     SET(SHAPER_INSTALL_TUI_DOC doc CACHE INTERNAL "" FORCE)
68 ENDIF(${HAVE_SALOME})
69
70 #IF(CMAKE_BUILD_TYPE MATCHES Release)
71 ADD_SUBDIRECTORY (doc)
72 #ENDIF(CMAKE_BUILD_TYPE MATCHES Release)
73 ADD_SUBDIRECTORY (src/Config)
74 ADD_SUBDIRECTORY (src/Events)
75 ADD_SUBDIRECTORY (src/Model)
76 ADD_SUBDIRECTORY (src/XAO)
77 ADD_SUBDIRECTORY (src/GeomAPI)
78 ADD_SUBDIRECTORY (src/ModelAPI)
79 ADD_SUBDIRECTORY (src/GeomAlgoAPI)
80 ADD_SUBDIRECTORY (src/GeomAlgoImpl)
81 ADD_SUBDIRECTORY (src/GeomData)
82 ADD_SUBDIRECTORY (src/GeomDataAPI)
83 ADD_SUBDIRECTORY (src/PartSetPlugin)
84 ADD_SUBDIRECTORY (src/ConstructionPlugin)
85 ADD_SUBDIRECTORY (src/BuildPlugin)
86 ADD_SUBDIRECTORY (src/FeaturesPlugin)
87 ADD_SUBDIRECTORY (src/SamplePanelPlugin)
88 ADD_SUBDIRECTORY (src/SketcherPrs)
89 ADD_SUBDIRECTORY (src/SketchPlugin)
90 ADD_SUBDIRECTORY (src/SketchSolver)
91 ADD_SUBDIRECTORY (src/ModuleBase)
92 ADD_SUBDIRECTORY (src/PartSet)
93
94 ADD_SUBDIRECTORY (src/XGUI)
95 ADD_SUBDIRECTORY (src/ExchangePlugin)
96 ADD_SUBDIRECTORY (src/GeomValidators)
97 ADD_SUBDIRECTORY (src/InitializationPlugin)
98 ADD_SUBDIRECTORY (src/ParametersPlugin)
99 ADD_SUBDIRECTORY (src/PythonAddons)
100 ADD_SUBDIRECTORY (src/PythonAPI)
101 # High Level C++/Python API
102 ADD_SUBDIRECTORY (src/ModelHighAPI)
103 ADD_SUBDIRECTORY (src/BuildAPI)
104 ADD_SUBDIRECTORY (src/ConnectorAPI)
105 ADD_SUBDIRECTORY (src/ConstructionAPI)
106 ADD_SUBDIRECTORY (src/ExchangeAPI)
107 ADD_SUBDIRECTORY (src/FeaturesAPI)
108 ADD_SUBDIRECTORY (src/ParametersAPI)
109 ADD_SUBDIRECTORY (src/PartSetAPI)
110 ADD_SUBDIRECTORY (src/SketchAPI)
111
112 IF(${HAVE_SALOME})
113     ADD_SUBDIRECTORY (src/SHAPERGUI)
114     ADD_SUBDIRECTORY (src/ConnectorPlugin)
115 ENDIF(${HAVE_SALOME})
116
117 ENABLE_TESTING()
118
119 # Add the uninstall target for eclipse IDE
120 if (CMAKE_GENERATOR MATCHES "NMake Makefiles")
121 configure_file("${CMAKE_SOURCE_DIR}/CMakeCommon/cmake_uninstall.cmake.in"
122                "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
123                IMMEDIATE @ONLY)
124 add_custom_target(uninstall
125                   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
126 endif (CMAKE_GENERATOR MATCHES "NMake Makefiles")