From 09c056fbf5c847bb311717a0e347bc35257f5648 Mon Sep 17 00:00:00 2001 From: bruneton Date: Wed, 10 Jul 2013 07:36:11 +0000 Subject: [PATCH] CMake: fixing KERNEL target references and KERNEL include dirs --- CMakeLists.txt | 23 ++++++++++++++++++++++- src/MEDOP/cmp/CMakeLists.txt | 20 ++++++++++---------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df0de1134..2f9760b24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,26 @@ SET(VERSION ${${PROJECT_NAME_UC}_VERSION}) SET(XVERSION 0x0${${PROJECT_NAME_UC}_MAJOR_VERSION}0${${PROJECT_NAME_UC}_MINOR_VERSION}0${${PROJECT_NAME_UC}_PATCH_VERSION}) SET(VERSION_DEV "0") +# +# Kernel detection comes before user options to be +# able to take previous values of SALOME_USE_MPI, SALOME_BUILD_DOC, etc ... +# +IF(NOT SALOME_MED_STANDALONE) + 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) + FIND_PACKAGE(SalomeKERNEL REQUIRED) + ELSE(EXISTS ${KERNEL_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR or turn option SALOME_MED_STANDALONE to ON !") + ENDIF(EXISTS ${KERNEL_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files") + FIND_PACKAGE(SalomeOmniORB REQUIRED) +ELSE(NOT SALOME_MED_STANDALONE) + LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local_without_kernel/cmake_files") + INCLUDE(SalomeMacros) +ENDIF(NOT SALOME_MED_STANDALONE) + # # User options # ============ @@ -58,7 +78,8 @@ OPTION(SALOME_BUILD_DOC "Build MED doc." ON) CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_METIS "Enable metis graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF) CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_SCOTCH "Enable scotch graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF) CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_PARMETIS "Enable parmetis graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;SALOME_USE_MPI" OFF) -# + + # # Set list of prerequisites # ========================= diff --git a/src/MEDOP/cmp/CMakeLists.txt b/src/MEDOP/cmp/CMakeLists.txt index a2801b36d..6077e963b 100644 --- a/src/MEDOP/cmp/CMakeLists.txt +++ b/src/MEDOP/cmp/CMakeLists.txt @@ -24,7 +24,7 @@ INCLUDE_DIRECTORIES( ${MEDFILE_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIRS} - ${KERNEL_ROOT_DIR}/include/salome + ${KERNEL_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ${PROJECT_SOURCE_DIR}/src/MEDCoupling @@ -41,15 +41,15 @@ SET(MEDOPFactoryEngine_SOURCES SET(COMMON_LIBS medloader SalomeIDLMED - ${TOOLSDS} - ${SalomeHDFPersist} - ${SalomeContainer} - ${SalomeCommunication} - ${SalomeKernelHelpers} - ${SalomeLifeCycleCORBA} - ${SALOMELocalTrace} - ${SALOMEBasics} - ${SalomeGenericObj} + ${KERNEL_TOOLSDS} + ${KERNEL_SalomeHDFPersist} + ${KERNEL_SalomeContainer} + ${KERNEL_SalomeCommunication} + ${KERNEL_SalomeKernelHelpers} + ${KERNEL_SalomeLifeCycleCORBA} + ${KERNEL_SALOMELocalTrace} + ${KERNEL_SALOMEBasics} + ${KERNEL_SalomeGenericObj} medcoupling interpkernel ${MEDFILE_C_LIBRARIES} -- 2.39.2