From 1becc2a7b73b6b15a26e1176f9f67aaad923228b Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Tue, 8 Sep 2020 19:36:09 +0200 Subject: [PATCH] restructuration of prerequisites detection as in SMESH, add GDAL info for reloaded targets from Paraview... --- CMakeLists.txt | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6648a44..7df21f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,39 +18,39 @@ 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) # =========== -- 2.39.2