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