From 3bdcb4ffb69449e2ea2e2756392d9e74ca6b55af Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 22 Apr 2021 11:58:23 +0200 Subject: [PATCH] Corrected compilation error. Cannot factor Find(SalomeKernel) --- CoreFlows/CMakeLists.txt | 22 ---------------------- CoreFlows/examples/Python/CMakeLists.txt | 21 +++++++++++++++++++++ CoreFlows/gui/salome/CMakeLists.txt | 21 +++++++++++++++++++++ 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/CoreFlows/CMakeLists.txt b/CoreFlows/CMakeLists.txt index 2ae4ed2..c517df2 100755 --- a/CoreFlows/CMakeLists.txt +++ b/CoreFlows/CMakeLists.txt @@ -100,15 +100,6 @@ if ( (EXISTS $ENV{CONFIGURATION_ROOT_DIR}) AND (EXISTS $ENV{KERNEL_ROOT_DIR}) A 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} ) - 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} ) - # Find SALOME GUI # ============== SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI") @@ -118,19 +109,6 @@ if ( (EXISTS $ENV{CONFIGURATION_ROOT_DIR}) AND (EXISTS $ENV{KERNEL_ROOT_DIR}) A MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR!") ENDIF(EXISTS ${GUI_ROOT_DIR}) - # Platform setup - # ============== - INCLUDE(SalomeSetupPlatform) # From KERNEL - - # Prerequisites - # ============= - - # Mandatory products - FIND_PACKAGE(SalomePythonInterp REQUIRED) - FIND_PACKAGE(SalomePythonLibs REQUIRED) - - MESSAGE(STATUS "SalomeKERNEL_VERSION is ${SalomeKERNEL_VERSION}") - endif( (EXISTS $ENV{CONFIGURATION_ROOT_DIR}) AND (EXISTS $ENV{KERNEL_ROOT_DIR}) AND (EXISTS $ENV{GUI_ROOT_DIR}) ) # #---------------------------------------------------------------------------------------------------------------# diff --git a/CoreFlows/examples/Python/CMakeLists.txt b/CoreFlows/examples/Python/CMakeLists.txt index 4cffece..b82b7f9 100755 --- a/CoreFlows/examples/Python/CMakeLists.txt +++ b/CoreFlows/examples/Python/CMakeLists.txt @@ -2,6 +2,27 @@ # if ( (EXISTS $ENV{CONFIGURATION_ROOT_DIR}) AND (EXISTS $ENV{KERNEL_ROOT_DIR}) AND (EXISTS $ENV{GUI_ROOT_DIR}) ) + # 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 NO_POLICY_SCOPE) + ELSE() + MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !") + ENDIF() + # + # Find Salome KERNEL + # ================== + SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") + 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} ) + + MESSAGE(STATUS "SalomeKERNEL_VERSION is ${SalomeKERNEL_VERSION}") + SET(_all_SCRIPTS SinglePhase/SOLVERLAB_2DSphericalExplosion_HEXAGON.py ) diff --git a/CoreFlows/gui/salome/CMakeLists.txt b/CoreFlows/gui/salome/CMakeLists.txt index 58bfcc3..bc4df7f 100755 --- a/CoreFlows/gui/salome/CMakeLists.txt +++ b/CoreFlows/gui/salome/CMakeLists.txt @@ -17,6 +17,27 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# 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 NO_POLICY_SCOPE) +ELSE() + MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !") +ENDIF() + # +# Find Salome KERNEL +# ================== +SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") +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} ) + +MESSAGE(STATUS "SalomeKERNEL_VERSION is ${SalomeKERNEL_VERSION}") + # Qt5 FIND_PACKAGE(SalomeQt5 REQUIRED COMPONENTS QtCore QtGui) -- 2.39.2