From b998652209b3fc710f9fcf89ab4c88ec7c082f78 Mon Sep 17 00:00:00 2001 From: mpa Date: Tue, 29 Oct 2013 08:07:30 +0000 Subject: [PATCH] CMake: - Accumulate environment variables, to be used later to run some command in proper environment. --- CMakeLists.txt | 8 +++++++- SalomeGEOMConfig.cmake.in | 3 +++ adm_local/cmake_files/FindSalomeGEOM.cmake | 4 ++++ adm_local/cmake_files/FindSalomeOpenCV.cmake | 6 +++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b9def891..b67be8576 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ ELSE(EXISTS ${KERNEL_ROOT_DIR}) ENDIF(EXISTS ${KERNEL_ROOT_DIR}) IF(SALOME_LIGHT_ONLY) - MESSAGE(FATAL_ERROR "GEOM module can't be built in Light mode (whiout CORBA)") + MESSAGE(FATAL_ERROR "GEOM module can't be built in Light mode (without CORBA)") ENDIF() # Platform setup @@ -197,6 +197,12 @@ MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED) MARK_AS_ADVANCED(SALOME_GEOM_INSTALL_RES_DATA SALOME_GEOM_INSTALL_RES_SCRIPTS SALOME_GEOM_INSTALL_PLUGINS) MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC) +# Accumulate environment variables for GEOM module +SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS} + ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON} + ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED}) +SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) + # Sources # ======== ADD_SUBDIRECTORY(idl) diff --git a/SalomeGEOMConfig.cmake.in b/SalomeGEOMConfig.cmake.in index 38a75bd97..bf98b089f 100644 --- a/SalomeGEOMConfig.cmake.in +++ b/SalomeGEOMConfig.cmake.in @@ -46,6 +46,9 @@ SET_AND_CHECK(GEOM_INCLUDE_DIRS "${GEOM_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") SET(GEOM_INCLUDE_DIRS "${GEOM_INCLUDE_DIRS};@_SalomeGEOM_EXTRA_HEADERS@") SET(GEOM_DEFINITIONS "@KERNEL_DEFINITIONS@") +# Package specific environment variables +@_SalomeGEOM_EXTRA_ENV_FULL@ + #### Now the specificities # Options exported by the package: diff --git a/adm_local/cmake_files/FindSalomeGEOM.cmake b/adm_local/cmake_files/FindSalomeGEOM.cmake index b33402698..867f2fe53 100644 --- a/adm_local/cmake_files/FindSalomeGEOM.cmake +++ b/adm_local/cmake_files/FindSalomeGEOM.cmake @@ -29,3 +29,7 @@ SALOME_FIND_PACKAGE(SalomeGEOM SalomeGEOM CONFIG) IF(NOT SalomeGEOM_FIND_QUIETLY) MESSAGE(STATUS "Found Salome GEOM: ${GEOM_ROOT_DIR}") ENDIF() + +FOREACH(_res ${SalomeGEOM_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeGEOM_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/adm_local/cmake_files/FindSalomeOpenCV.cmake b/adm_local/cmake_files/FindSalomeOpenCV.cmake index 6f31b756d..06ed9d654 100644 --- a/adm_local/cmake_files/FindSalomeOpenCV.cmake +++ b/adm_local/cmake_files/FindSalomeOpenCV.cmake @@ -19,9 +19,13 @@ # Author: Adrien Bruneton # -# OpenCV detection dor Salome +# OpenCV detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OpenCV OpenCV_DIR 2) #MARK_AS_ADVANCED() + +IF(OpenCV_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OpenCV_LIBRARIES}) +ENDIF() -- 2.39.2