From 1d2634c478fd59f8bdd78480a4a4d4b8ec260221 Mon Sep 17 00:00:00 2001 From: mpa Date: Thu, 31 Oct 2013 12:00:31 +0000 Subject: [PATCH] CMake: - Accumulate environment variables, to be used later to run some command in proper environment. --- CMakeLists.txt | 5 +++++ SalomePYCALCULATORConfig.cmake.in | 3 +++ adm_local/cmake_files/FindSalomePYCALCULATOR.cmake | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00ed638..71e24c6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,6 +127,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_PYCALCULATOR_INSTALL_RES_DATA) +# Accumulate environment variables for PYCALCULATOR 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/SalomePYCALCULATORConfig.cmake.in b/SalomePYCALCULATORConfig.cmake.in index 838ba9b..3d948f6 100644 --- a/SalomePYCALCULATORConfig.cmake.in +++ b/SalomePYCALCULATORConfig.cmake.in @@ -40,6 +40,9 @@ SET_AND_CHECK(PYCALCULATOR_INCLUDE_DIRS "${PYCALCULATOR_ROOT_DIR_EXP}/@SALOME_IN SET(PYCALCULATOR_INCLUDE_DIRS "${PYCALCULATOR_INCLUDE_DIRS};@_SalomePYCALCULATOR_EXTRA_HEADERS@") SET(PYCALCULATOR_DEFINITIONS "@MED_DEFINITIONS@") +# Package specific environment variables +@_SalomePYCALCULATOR_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/FindSalomePYCALCULATOR.cmake b/adm_local/cmake_files/FindSalomePYCALCULATOR.cmake index 5eaa5e3..8183612 100644 --- a/adm_local/cmake_files/FindSalomePYCALCULATOR.cmake +++ b/adm_local/cmake_files/FindSalomePYCALCULATOR.cmake @@ -27,4 +27,8 @@ SALOME_FIND_PACKAGE(SalomePYCALCULATOR SalomePYCALCULATOR CONFIG) IF(NOT SalomePYCALCULATOR_FIND_QUIETLY) MESSAGE(STATUS "Found Salome PYCALCULATOR: ${PYCALCULATOR_ROOT_DIR}") -ENDIF() \ No newline at end of file +ENDIF() + +FOREACH(_res ${SalomePYCALCULATOR_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomePYCALCULATOR_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file -- 2.39.2