From: mpa Date: Tue, 29 Oct 2013 07:03:33 +0000 (+0000) Subject: CMake: X-Git-Tag: BR_hydro_v_0_3_1~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bf775cfc7109efa61e4c41678a4d880cd346f9f2;p=modules%2Fgui.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 bee2f53d5..d9b903c12 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,6 +189,13 @@ MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED) MARK_AS_ADVANCED(SALOME_GUI_INSTALL_PARAVIEW_LIBS SALOME_GUI_INSTALL_RES_DATA SALOME_GUI_INSTALL_RES_SCRIPTS SALOME_GUI_INSTALL_PLUGINS) MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC) +# Accumulate environment variables for GUI 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} + ${CMAKE_INSTALL_PREFIX}/${SALOME_GUI_INSTALL_PARAVIEW_LIBS}) + # Sources # ======== IF(NOT SALOME_LIGHT_ONLY) diff --git a/SalomeGUIConfig.cmake.in b/SalomeGUIConfig.cmake.in index b8493d58a..45f22ada4 100644 --- a/SalomeGUIConfig.cmake.in +++ b/SalomeGUIConfig.cmake.in @@ -46,6 +46,9 @@ SET_AND_CHECK(GUI_INCLUDE_DIRS "${GUI_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") SET(GUI_INCLUDE_DIRS "${GUI_INCLUDE_DIRS};@_SalomeGUI_EXTRA_HEADERS@") SET(GUI_DEFINITIONS "@KERNEL_DEFINITIONS@") +# Package specific environment variables +@_SalomeGUI_EXTRA_ENV_FULL@ + #### Now the specificities # Options exported by the package: diff --git a/adm_local/cmake_files/FindSalomeGUI.cmake b/adm_local/cmake_files/FindSalomeGUI.cmake index f397b0708..73c40ece6 100644 --- a/adm_local/cmake_files/FindSalomeGUI.cmake +++ b/adm_local/cmake_files/FindSalomeGUI.cmake @@ -36,4 +36,8 @@ SALOME_FIND_PACKAGE(SalomeGUI SalomeGUI CONFIG) IF(NOT SalomeGUI_FIND_QUIETLY) MESSAGE(STATUS "Found Salome GUI: ${GUI_ROOT_DIR}") -ENDIF() \ No newline at end of file +ENDIF() + +FOREACH(_res ${SalomeGUI_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeGUI_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/adm_local/cmake_files/FindSalomeOpenGL.cmake b/adm_local/cmake_files/FindSalomeOpenGL.cmake index 49028bdb7..d93f633b2 100644 --- a/adm_local/cmake_files/FindSalomeOpenGL.cmake +++ b/adm_local/cmake_files/FindSalomeOpenGL.cmake @@ -19,7 +19,7 @@ # Author: Adrien Bruneton # -# OpenGL detection dor Salome +# OpenGL detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # @@ -31,5 +31,8 @@ ENDIF() SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OpenGL OPENGL_INCLUDE_DIR 1) #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(OPENGL_INCLUDE_DIR) +IF(OPENGL_FOUND) + SALOME_ACCUMULATE_HEADERS(OPENGL_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OPENGL_LIBRARIES}) +ENDIF() diff --git a/adm_local/cmake_files/FindSalomePyQt4.cmake b/adm_local/cmake_files/FindSalomePyQt4.cmake index 279bcbc54..31ea8fbfb 100644 --- a/adm_local/cmake_files/FindSalomePyQt4.cmake +++ b/adm_local/cmake_files/FindSalomePyQt4.cmake @@ -19,7 +19,7 @@ # Author: Adrien Bruneton # -# PyQt4 detection dor Salome +# PyQt4 detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # @@ -29,3 +29,10 @@ FIND_PACKAGE(SalomeSIP REQUIRED) SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PyQt4 PYQT_PYUIC_EXECUTABLE 2) MARK_AS_ADVANCED(PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_PYUIC_PATH PYQT_PYRCC_PATH) + +IF(PYQT4_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYQT4_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYQT4_ROOT_DIR}/PyQt4) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYQT4_ROOT_DIR} + ${PYQT4_ROOT_DIR}/PyQt4) +ENDIF() diff --git a/adm_local/cmake_files/FindSalomeQt4.cmake b/adm_local/cmake_files/FindSalomeQt4.cmake index 2378d71d2..ccca972b4 100644 --- a/adm_local/cmake_files/FindSalomeQt4.cmake +++ b/adm_local/cmake_files/FindSalomeQt4.cmake @@ -19,11 +19,16 @@ # Author: Adrien Bruneton # -# Qt4 detection dor Salome +# Qt4 detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt4 QT_INCLUDES 2) MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE) -SALOME_ACCUMULATE_HEADERS(QT_INCLUDES) +IF(QT4_FOUND) + SALOME_ACCUMULATE_HEADERS(QT_INCLUDES) + SALOME_ACCUMULATE_ENVIRONMENT(QT_PLUGIN_PATH ${QT4_ROOT_DIR}/plugins) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${QT4_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QT4_ROOT_DIR}/lib) +ENDIF() diff --git a/adm_local/cmake_files/FindSalomeQwt.cmake b/adm_local/cmake_files/FindSalomeQwt.cmake index 5490aa9ae..14bd8832a 100644 --- a/adm_local/cmake_files/FindSalomeQwt.cmake +++ b/adm_local/cmake_files/FindSalomeQwt.cmake @@ -26,4 +26,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qwt QWT_INCLUDE_DIR 1) MARK_AS_ADVANCED(QWT_INCLUDE_DIR QWT_LIBRARY) -SALOME_ACCUMULATE_HEADERS(QWT_INCLUDE_DIR) \ No newline at end of file +IF(QWT_FOUND) + SALOME_ACCUMULATE_HEADERS(QWT_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QWT_ROOT_DIR}/lib) +ENDIF() \ No newline at end of file diff --git a/adm_local/cmake_files/FindSalomeSIP.cmake b/adm_local/cmake_files/FindSalomeSIP.cmake index 9406e45bc..496e74516 100644 --- a/adm_local/cmake_files/FindSalomeSIP.cmake +++ b/adm_local/cmake_files/FindSalomeSIP.cmake @@ -19,9 +19,16 @@ # Author: Adrien Bruneton # -# SIP detection dor Salome +# SIP detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SIP SIP_EXECUTABLE 2) MARK_AS_ADVANCED(SIP_EXECUTABLE SIP_INCLUDE_DIR) + +IF(SIP_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SIP_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SIP_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SIP_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) +ENDIF() +