From d6d58b4cc8e7337cdbb0dc5d5502519c28e0483d Mon Sep 17 00:00:00 2001 From: mpa Date: Thu, 31 Oct 2013 12:16:22 +0000 Subject: [PATCH] CMake: - Accumulate environment variables, to be used later to run some command in proper environment. --- CMakeLists.txt | 5 +++++ SalomeRANDOMIZERConfig.cmake.in | 3 +++ adm_local/cmake_files/FindSalomeRANDOMIZER.cmake | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48358e2..74316b1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,11 @@ MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED) MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC) MARK_AS_ADVANCED(SALOME_RANDOMIZER_INSTALL_RES_DATA) +# Accumulate environment variables for RANDOMIZER module +SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS} + ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}) +SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) + # Sources # ======== diff --git a/SalomeRANDOMIZERConfig.cmake.in b/SalomeRANDOMIZERConfig.cmake.in index 06690d2..1b9bef5 100644 --- a/SalomeRANDOMIZERConfig.cmake.in +++ b/SalomeRANDOMIZERConfig.cmake.in @@ -40,6 +40,9 @@ SET_AND_CHECK(RANDOMIZER_INCLUDE_DIRS "${RANDOMIZER_ROOT_DIR_EXP}/@SALOME_INSTAL SET(RANDOMIZER_INCLUDE_DIRS "${RANDOMIZER_INCLUDE_DIRS};@_SalomeRANDOMIZER_EXTRA_HEADERS@") SET(RANDOMIZER_DEFINITIONS "@KERNEL_DEFINITIONS@") +# Package specific environment variables +@_SalomeRANDOMIZER_EXTRA_ENV_FULL@ + # Load the dependencies for the libraries of @PROJECT_NAME@ # (contains definitions for IMPORTED targets). This is only # imported if we are not built as a subproject (in this case targets are already there) diff --git a/adm_local/cmake_files/FindSalomeRANDOMIZER.cmake b/adm_local/cmake_files/FindSalomeRANDOMIZER.cmake index 21875c6..2cb88d7 100644 --- a/adm_local/cmake_files/FindSalomeRANDOMIZER.cmake +++ b/adm_local/cmake_files/FindSalomeRANDOMIZER.cmake @@ -27,4 +27,8 @@ SALOME_FIND_PACKAGE(SalomeRANDOMIZER SalomeRANDOMIZER CONFIG) IF(NOT SalomeRANDOMIZER_FIND_QUIETLY) MESSAGE(STATUS "Found Salome RANDOMIZER: ${RANDOMIZER_ROOT_DIR}") -ENDIF() \ No newline at end of file +ENDIF() + +FOREACH(_res ${SalomeRANDOMIZER_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeRANDOMIZER_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file -- 2.39.2