Salome HOME
Prepare a version CEA_2018-2
[modules/shaper.git] / CMakeLists.txt
index 67da105d280076e77e23aec24c16a9e41f165a30..6f304808df36ae308b3c73e432939cc8f2ca0bb5 100644 (file)
@@ -27,21 +27,53 @@ IF(WIN32)
   CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib
 ENDIF(WIN32)
 
-SET (SHAPER_Version 2.9.0)
+SET (SHAPER_Version CEA_2018-2)
 
 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
+OPTION(SHAPER_BUILD_DOC "Generate SHAPER documentation" ON)
 
 INCLUDE(SalomeMacros)
 
 INCLUDE(FindEclipse)
 INCLUDE(Common)
 INCLUDE(FindSalomeQt5)
-INCLUDE(FindPython)
 INCLUDE(FindSalome)
-INCLUDE(FindCAS)
 INCLUDE(FindSUIT)
 INCLUDE(FindTInspector)
 
+IF(${HAVE_SALOME})
+  SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
+  IF(EXISTS ${CONFIGURATION_ROOT_DIR})
+    LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
+    INCLUDE(SalomeMacros)
+  ELSE()
+    MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
+  ENDIF()
+  SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
+  IF(EXISTS ${KERNEL_ROOT_DIR})
+    LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
+    FIND_PACKAGE(SalomeKERNEL REQUIRED)
+    ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
+    INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
+  ELSE(EXISTS ${KERNEL_ROOT_DIR})
+    MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
+  ENDIF(EXISTS ${KERNEL_ROOT_DIR})
+  INCLUDE(SalomeSetupPlatform)   # From CONFIGURATION
+
+  FIND_PACKAGE(SalomePythonInterp REQUIRED)
+  FIND_PACKAGE(SalomePythonLibs REQUIRED)
+
+  FIND_PACKAGE(SalomeOpenCASCADE REQUIRED)
+
+ELSE(${HAVE_SALOME})
+  INCLUDE(FindPython)
+  INCLUDE(FindSalomeOpenCASCADE)
+ENDIF(${HAVE_SALOME})
+
+# Common CMake macros
+# ===================
+
+
 # Find LibXml2
 IF(DEFINED ENV{LIBXML2_ROOT_DIR})
     IF(WIN32)
@@ -69,7 +101,6 @@ IF(${HAVE_SALOME})
     SET(SHAPER_INSTALL_GUI_DOC share/doc/salome/gui/SHAPER CACHE INTERNAL "" FORCE)
     SET(SHAPER_INSTALL_TUI_DOC share/doc/salome/tui/SHAPER CACHE INTERNAL "" FORCE)
     # without SALOME there is another kind of documentation, separated one
-    ADD_SUBDIRECTORY (doc)
 ELSE(${HAVE_SALOME})
     SET(SHAPER_INSTALL_ADDONS addons CACHE INTERNAL "" FORCE)
     SET(SHAPER_INSTALL_BIN bin CACHE INTERNAL "" FORCE)
@@ -83,7 +114,7 @@ ELSE(${HAVE_SALOME})
 ENDIF(${HAVE_SALOME})
 
 # Sketcher: Change radius of circular edges while dragging a point on the edge
-SET(SKETCHER_CHANGE_RADIUS_WHEN_MOVE FALSE)
+SET(SKETCHER_CHANGE_RADIUS_WHEN_MOVE TRUE)
 
 ADD_SUBDIRECTORY (src/Config)
 ADD_SUBDIRECTORY (src/Events)
@@ -120,7 +151,6 @@ ADD_SUBDIRECTORY (src/PythonAPI)
 # High Level C++/Python API
 ADD_SUBDIRECTORY (src/ModelHighAPI)
 ADD_SUBDIRECTORY (src/BuildAPI)
-ADD_SUBDIRECTORY (src/ConnectorAPI)
 ADD_SUBDIRECTORY (src/ConstructionAPI)
 ADD_SUBDIRECTORY (src/ExchangeAPI)
 ADD_SUBDIRECTORY (src/FeaturesAPI)
@@ -130,6 +160,7 @@ ADD_SUBDIRECTORY (src/PartSetAPI)
 ADD_SUBDIRECTORY (src/PrimitivesAPI)
 ADD_SUBDIRECTORY (src/SketchAPI)
 ADD_SUBDIRECTORY (src/GDMLAPI)
+ADD_SUBDIRECTORY (src/ConnectorAPI)
 # Tests
 ADD_SUBDIRECTORY (test.API/SHAPER)
 
@@ -145,6 +176,14 @@ IF(ADD_MODELS_TESTS)
   ADD_CUSTOM_TARGET(run_unit_tests COMMAND ${CMAKE_CTEST_COMMAND} -C "${CMAKE_BUILD_TYPE}" -LE "models_tests")
 ENDIF(ADD_MODELS_TESTS)
 
+
+IF(SHAPER_BUILD_DOC)
+    INCLUDE(FindSphinx)
+    ADD_SUBDIRECTORY (doc)
+ENDIF(SHAPER_BUILD_DOC)
+
+
+
 # Add the uninstall target for eclipse IDE
 if (CMAKE_GENERATOR MATCHES "NMake Makefiles")
 configure_file("${CMAKE_SOURCE_DIR}/CMakeCommon/cmake_uninstall.cmake.in"