]> SALOME platform Git repositories - modules/hydrosolver.git/commitdiff
Salome HOME
restructuration of prerequisites detection as in SMESH, add GDAL info for reloaded...
authorPaul RASCLE <paul.rascle@openfields.fr>
Tue, 8 Sep 2020 17:36:09 +0000 (19:36 +0200)
committerYOANN AUDOUIN <B61570@dsp0851742.postes.calibre.edf.fr>
Fri, 30 Oct 2020 16:04:18 +0000 (17:04 +0100)
CMakeLists.txt

index 6648a4436e60248d68b93032c01126280910b29a..7df21f55a922fd5a2798ff8c8aa21c27d59bd396 100644 (file)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
 PROJECT(SalomeHYDROSOLVER C CXX)
 
-# Ensure a proper linker behavior:
-CMAKE_POLICY(SET CMP0003 NEW)
-
 # Versioning
 # ===========
 # Project name, upper case
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 2)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 0)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 2)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
 SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
-# Find KERNEL
-# ===========
+# Common CMake macros
+# ===================
 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)
+  INCLUDE(SalomeMacros NO_POLICY_SCOPE)
 ELSE()
   MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
 ENDIF()
 
+# Find KERNEL
+# ==============
 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")
-  #INCLUDE(SalomeMacros)
+IF( EXISTS ${KERNEL_ROOT_DIR} )
   FIND_PACKAGE(SalomeKERNEL REQUIRED)
-ELSE(EXISTS ${KERNEL_ROOT_DIR})
-  MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
-ENDIF(EXISTS ${KERNEL_ROOT_DIR})
+  KERNEL_WITH_CORBA() #check whether KERNEL built with CORBA
+  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 or turn option SALOME_HYDRO_USE_KERNEL to OFF !")
+ENDIF( EXISTS ${KERNEL_ROOT_DIR} )
 
 # Platform setup
 # ==============
@@ -74,7 +74,6 @@ OPTION(SALOME_BUILD_DOC "Generate SALOME HYDROSOLVER documentation" ON)
 ##
 FIND_PACKAGE(SalomePythonInterp REQUIRED)
 FIND_PACKAGE(SalomePythonLibs REQUIRED)
-#FIND_PACKAGE(SalomePython REQUIRED)
 FIND_PACKAGE(SalomeOmniORB REQUIRED)
 FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
 FIND_PACKAGE(SalomeSWIG REQUIRED)
@@ -90,6 +89,12 @@ ENDIF()
 
 # Find GUI
 # ===========
+SET(GDAL_ROOT_DIR $ENV{GDALHOME})          # When looking for Salome GUI, reloading targets from Paraview
+IF(EXISTS ${GDAL_ROOT_DIR})
+  SET(GDAL_LIBRARY ${GDAL_ROOT_DIR}/lib)
+  SET(GDAL_INCLUDE_DIR ${GDAL_ROOT_DIR}/include)
+ENDIF(EXISTS ${GDAL_ROOT_DIR})
+
 SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
 IF(EXISTS ${GUI_ROOT_DIR})
   LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
@@ -111,6 +116,9 @@ FIND_PACKAGE(SalomePyQt5 REQUIRED)
 
 FIND_PACKAGE(SalomeTelemac REQUIRED)
 
+# Detection summary:
+SALOME_PACKAGE_REPORT_AND_CHECK()
+
 # Directories
 # (default values taken from KERNEL)
 # ===========