From: mpa Date: Thu, 31 Oct 2013 13:49:13 +0000 (+0000) Subject: CMake: X-Git-Tag: V7_3_0a1~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=976b6c8dd499c1cd3e5618883c69c76021764e73;p=modules%2Fmed.git CMake: - Accumulate environment variables, to be used later to run some command in proper environment. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 80630db8b..13105ef33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,12 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MED_version.h DESTINATION ${SALOME_INS CONFIGURE_FILE(VERSION.in VERSION @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION ${SALOME_INSTALL_BINS}) +# Accumulate environment variables for MED 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 # ======== IF(WIN32) diff --git a/SalomeMEDConfig.cmake.in b/SalomeMEDConfig.cmake.in index c0e2a02ab..870da99c6 100644 --- a/SalomeMEDConfig.cmake.in +++ b/SalomeMEDConfig.cmake.in @@ -46,6 +46,9 @@ SET_AND_CHECK(MED_INCLUDE_DIRS "${MED_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") SET(MED_INCLUDE_DIRS "${MED_INCLUDE_DIRS};@_SalomeMED_EXTRA_HEADERS@") SET(MED_DEFINITIONS) +# Package specific environment variables +@_SalomeMED_EXTRA_ENV_FULL@ + #### Now the specificities # Options exported by the package: diff --git a/adm_local/cmake_files/FindSalomeMED.cmake b/adm_local/cmake_files/FindSalomeMED.cmake index b984405ea..88bd3113d 100644 --- a/adm_local/cmake_files/FindSalomeMED.cmake +++ b/adm_local/cmake_files/FindSalomeMED.cmake @@ -37,3 +37,7 @@ SALOME_FIND_PACKAGE(SalomeMED SalomeMED CONFIG) IF(NOT SalomeMED_FIND_QUIETLY) MESSAGE(STATUS "Found Salome MED: ${MED_ROOT_DIR}") ENDIF() + +FOREACH(_res ${SalomeMED_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeMED_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/adm_local/cmake_files/FindSalomeMetis.cmake b/adm_local/cmake_files/FindSalomeMetis.cmake index c0b1c4045..4268c26f5 100644 --- a/adm_local/cmake_files/FindSalomeMetis.cmake +++ b/adm_local/cmake_files/FindSalomeMetis.cmake @@ -27,4 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Metis METIS_INCLUDE_DIRS 1) #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(METIS_INCLUDE_DIRS) +IF(METIS_FOUND) + SALOME_ACCUMULATE_HEADERS(METIS_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${METIS_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/adm_local/cmake_files/FindSalomeParMetis.cmake b/adm_local/cmake_files/FindSalomeParMetis.cmake index b8025a511..6587a65f6 100644 --- a/adm_local/cmake_files/FindSalomeParMetis.cmake +++ b/adm_local/cmake_files/FindSalomeParMetis.cmake @@ -27,4 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParMetis PARMETIS_INCLUDE_DIRS 1) #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(PARMETIS_INCLUDE_DIRS) \ No newline at end of file +IF(PARMETIS_FOUND) + SALOME_ACCUMULATE_HEADERS(PARMETIS_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PARMETIS_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/adm_local/cmake_files/FindSalomeScotch.cmake b/adm_local/cmake_files/FindSalomeScotch.cmake index b8fd552c9..7ac73fb1e 100644 --- a/adm_local/cmake_files/FindSalomeScotch.cmake +++ b/adm_local/cmake_files/FindSalomeScotch.cmake @@ -27,4 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Scotch SCOTCH_INCLUDE_DIRS 1) #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(SCOTCH_INCLUDE_DIRS) \ No newline at end of file +IF(SCOTCH_FOUND) + SALOME_ACCUMULATE_HEADERS(SCOTCH_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SCOTCH_LIBRARIES}) +ENDIF() diff --git a/adm_local/cmake_files/FindSalomeXDR.cmake b/adm_local/cmake_files/FindSalomeXDR.cmake index 36d091789..2db53e88f 100644 --- a/adm_local/cmake_files/FindSalomeXDR.cmake +++ b/adm_local/cmake_files/FindSalomeXDR.cmake @@ -27,4 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(XDR XDR_FOUND 1) #MARK_AS_ADVANCED() -#SALOME_ACCUMULATE_HEADERS(XDR_INCLUDE_DIRS) # useless here because XDR is used only in CXX of MEDLoader +#IF(XDR_FOUND) # useless here because XDR is used only in CXX of MEDLoader +# SALOME_ACCUMULATE_HEADERS(XDR_INCLUDE_DIRS) +# SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${XDR_LIBRARIES}) +#ENDIF() \ No newline at end of file