From: mpa Date: Thu, 31 Oct 2013 11:52:42 +0000 (+0000) Subject: CMake: X-Git-Tag: V7_3_0a1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=440d8e07573b325d5036e2ba53101582cf2df3a3;p=plugins%2Fnetgenplugin.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 de6b16e..85dabe1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,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_NETGENPLUGIN_INSTALL_RES_DATA) +# Accumulate environment variables for NETGENPLUGIN 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/SalomeNETGENPLUGINConfig.cmake.in b/SalomeNETGENPLUGINConfig.cmake.in index b1ce054..cda17a9 100644 --- a/SalomeNETGENPLUGINConfig.cmake.in +++ b/SalomeNETGENPLUGINConfig.cmake.in @@ -46,6 +46,9 @@ SET_AND_CHECK(NETGENPLUGIN_INCLUDE_DIRS "${NETGENPLUGIN_ROOT_DIR_EXP}/@SALOME_IN SET(NETGENPLUGIN_INCLUDE_DIRS "${NETGENPLUGIN_INCLUDE_DIRS};@_SalomeNETGENPLUGIN_EXTRA_HEADERS@") SET(NETGENPLUGIN_DEFINITIONS "@SMESH_DEFINITIONS@") +# Package specific environment variables +@_SalomeNETGENPLUGIN_EXTRA_ENV_FULL@ + #### Now the specificities # Options exported by the package: diff --git a/adm_local/cmake_files/FindSalomeNETGENPLUGIN.cmake b/adm_local/cmake_files/FindSalomeNETGENPLUGIN.cmake index ff619ee..29bfcc4 100644 --- a/adm_local/cmake_files/FindSalomeNETGENPLUGIN.cmake +++ b/adm_local/cmake_files/FindSalomeNETGENPLUGIN.cmake @@ -29,3 +29,7 @@ SALOME_FIND_PACKAGE(SalomeNETGENPLUGIN SalomeNETGENPLUGIN CONFIG) IF(NOT SalomeNETGENPLUGIN_FIND_QUIETLY) MESSAGE(STATUS "Found Salome NETGENPLUGIN: ${NETGENPLUGIN_ROOT_DIR}") ENDIF() + +FOREACH(_res ${SalomeNETGENPLUGIN_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeNETGENPLUGIN_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/adm_local/cmake_files/FindSalomeNetgen.cmake b/adm_local/cmake_files/FindSalomeNetgen.cmake index 42b51bc..27c0d17 100644 --- a/adm_local/cmake_files/FindSalomeNetgen.cmake +++ b/adm_local/cmake_files/FindSalomeNetgen.cmake @@ -20,4 +20,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Netgen NETGEN_INCLUDE_DIRS 1) MARK_AS_ADVANCED(NETGEN_INCLUDE_DIRS NETGEN_LIBRARIES) -SALOME_ACCUMULATE_HEADERS(NETGEN_INCLUDE_DIRS) +IF(NETGEN_FOUND) + SALOME_ACCUMULATE_HEADERS(NETGEN_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${NETGEN_LIBRARIES}) +ENDIF()