Salome HOME
Update copyrights
[modules/shaper.git] / CMakeLists.txt
index d8884967969f041dd21838a416f12997550bc557..f7e2f9ad464a511d8feb6ead85f8d22ebdf62fd8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## See http:##www.salome-platform.org/ or
-## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
 
@@ -27,21 +26,53 @@ IF(WIN32)
   CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib
 ENDIF(WIN32)
 
-SET (SHAPER_Version 8.5.0)
+SET (SHAPER_Version 9.2.0_Jan2019)
 
 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 +100,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,10 +113,11 @@ 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)
+ADD_SUBDIRECTORY (src/Selector)
 ADD_SUBDIRECTORY (src/Model)
 ADD_SUBDIRECTORY (src/XAO)
 ADD_SUBDIRECTORY (src/GeomAPI)
@@ -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"