From: mpa Date: Tue, 29 Oct 2013 06:33:34 +0000 (+0000) Subject: CMake: X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2ce5f9594e46d28d202292d4c89e72cbb2d8fa79;p=modules%2Fyacs.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 ed390c814..7bca13653 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,6 +168,12 @@ MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTH MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED SALOME_KERNEL_INSTALL_RES_DATA SALOME_KERNEL_INSTALL_RES_SCRIPTS SALOME_INSTALL_DOC) MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG SALOME_INSTALL_AMCONFIG_LOCAL) +# Accumulate environment variables for KERNEL 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}) + # Sources # ======== IF(NOT SALOME_LIGHT_ONLY) @@ -193,7 +199,7 @@ INCLUDE(CMakePackageConfigHelpers) # List of targets in this project we want to make visible to the rest of the world. # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" -# Temporary solution for pakage src\DSC on windows +# Temporary solution for package src\DSC on windows IF(NOT WIN32) SET(DSC_TGS CalciumC SalomeCalcium SalomeDatastream SalomePalm SalomeDSCSupervBasic SalomeDSCSuperv) diff --git a/salome_adm/cmake_files/FindSalomeBoost.cmake b/salome_adm/cmake_files/FindSalomeBoost.cmake index 5deff116d..f25767218 100644 --- a/salome_adm/cmake_files/FindSalomeBoost.cmake +++ b/salome_adm/cmake_files/FindSalomeBoost.cmake @@ -45,4 +45,8 @@ IF(WIN32) SET(BOOST_DEFINITIONS -DBOOST_DISABLE_ASSERTS -DBOOST_ALL_DYN_LINK) ENDIF() -SALOME_ACCUMULATE_HEADERS(Boost_INCLUDE_DIRS) +IF(Boost_FOUND OR BOOST_FOUND) + SALOME_ACCUMULATE_HEADERS(Boost_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${BOOST_ROOT_DIR}/lib) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${BOOST_ROOT_DIR}/include) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeCAS.cmake b/salome_adm/cmake_files/FindSalomeCAS.cmake index 91bf92549..a440326d0 100644 --- a/salome_adm/cmake_files/FindSalomeCAS.cmake +++ b/salome_adm/cmake_files/FindSalomeCAS.cmake @@ -46,6 +46,8 @@ ELSE() ENDIF() ENDIF() -SALOME_ACCUMULATE_HEADERS(CAS_INCLUDE_DIRS) - - +IF(CAS_FOUND) + SALOME_ACCUMULATE_HEADERS(CAS_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${CAS_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CAS_ROOT_DIR}/lib ${CAS_ROOT_DIR}/lin/lib) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeCppUnit.cmake b/salome_adm/cmake_files/FindSalomeCppUnit.cmake index e8a5527e9..9e20e145f 100644 --- a/salome_adm/cmake_files/FindSalomeCppUnit.cmake +++ b/salome_adm/cmake_files/FindSalomeCppUnit.cmake @@ -27,4 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(CppUnit CPPUNIT_INCLUDE_DIRS 1) MARK_AS_ADVANCED(CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES CPPUNIT_CONFIG_BIN CPPUNIT_SUBLIB_cppunit CPPUNIT_SUBLIB_dl) -SALOME_ACCUMULATE_HEADERS(CPPUNIT_INCLUDE_DIRS) +IF(CPPUNIT_FOUND) + SALOME_ACCUMULATE_HEADERS(CPPUNIT_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CPPUNIT_LIBRARIES}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeDoxygen.cmake b/salome_adm/cmake_files/FindSalomeDoxygen.cmake index b217886d3..511d81bc4 100644 --- a/salome_adm/cmake_files/FindSalomeDoxygen.cmake +++ b/salome_adm/cmake_files/FindSalomeDoxygen.cmake @@ -38,3 +38,7 @@ IF(DOXYGEN_FOUND) ENDIF() ENDIF() MARK_AS_ADVANCED(DOXYGEN_SUPPORT_STL) + +IF(DOXYGEN_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${DOXYGEN_ROOT_DIR}/bin) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeGraphviz.cmake b/salome_adm/cmake_files/FindSalomeGraphviz.cmake index e355263b1..bbefabff2 100644 --- a/salome_adm/cmake_files/FindSalomeGraphviz.cmake +++ b/salome_adm/cmake_files/FindSalomeGraphviz.cmake @@ -26,3 +26,9 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Graphviz GRAPHVIZ_EXECUTABLE GRAPHVIZ_LIBRARIES GRAPHVIZ_INCLUDE_DIRS 2) MARK_AS_ADVANCED(GRAPHVIZ_EXECUTABLE GRAPHVIZ_LIBRARIES GRAPHVIZ_INCLUDE_DIRS) + +IF(GRAPHVIZ_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${GRAPHVIZ_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${GRAPHVIZ_ROOT_DIR}/lib + ${GRAPHVIZ_ROOT_DIR}/lib/graphviz) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeHDF5.cmake b/salome_adm/cmake_files/FindSalomeHDF5.cmake index c6460a944..de7dc234d 100644 --- a/salome_adm/cmake_files/FindSalomeHDF5.cmake +++ b/salome_adm/cmake_files/FindSalomeHDF5.cmake @@ -42,8 +42,6 @@ IF(NOT DEFINED HDF5_LIBRARIES) SET(HDF5_LIBRARIES hdf5) ENDIF() -SALOME_ACCUMULATE_HEADERS(HDF5_INCLUDE_DIRS) - ## ## 7. Specific to HDF5 only: ## Expose MPI configuration to the rest of the world @@ -85,3 +83,9 @@ ENDIF() if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES ${PREV_CMAKE_FIND_LIBRARY_SUFFIXES}) endif() + +IF(HDF5_FOUND) + SALOME_ACCUMULATE_HEADERS(HDF5_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${HDF5_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${HDF5_ROOT_DIR}/lib) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeLibBatch.cmake b/salome_adm/cmake_files/FindSalomeLibBatch.cmake index d7ce2e54e..379f93c1d 100644 --- a/salome_adm/cmake_files/FindSalomeLibBatch.cmake +++ b/salome_adm/cmake_files/FindSalomeLibBatch.cmake @@ -19,7 +19,7 @@ # Author: Adrien Bruneton # -# LibBatch detection dor Salome +# LibBatch detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # @@ -27,5 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibBatch LIBBATCH_ROOT_DIR_EXP 0) #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(LIBBATCH_INCLUDE_DIRS) - +IF(SALOMELIBBATCH_FOUND) + SALOME_ACCUMULATE_HEADERS(LIBBATCH_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${LIBBATCH_ROOT_DIR}/lib) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeLibXml2.cmake b/salome_adm/cmake_files/FindSalomeLibXml2.cmake index c736b2e63..60c4dbcd5 100644 --- a/salome_adm/cmake_files/FindSalomeLibXml2.cmake +++ b/salome_adm/cmake_files/FindSalomeLibXml2.cmake @@ -28,4 +28,8 @@ ELSE() ENDIF() #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(LIBXML2_INCLUDE_DIR) +IF(LIBXML2_FOUND) + SALOME_ACCUMULATE_HEADERS(LIBXML2_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${LIBXML2_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${LIBXML2_ROOT_DIR}/lib) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeMEDFile.cmake b/salome_adm/cmake_files/FindSalomeMEDFile.cmake index b53e057b5..9777406b2 100644 --- a/salome_adm/cmake_files/FindSalomeMEDFile.cmake +++ b/salome_adm/cmake_files/FindSalomeMEDFile.cmake @@ -19,7 +19,7 @@ # Author: Adrien Bruneton # -# Medfile detection dor Salome +# Medfile detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # @@ -27,4 +27,8 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(MEDFile MEDFILE_INCLUDE_DIRS 1) #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(MEDFILE_INCLUDE_DIRS) \ No newline at end of file +IF(MEDFILE_FOUND) + SALOME_ACCUMULATE_HEADERS(MEDFILE_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${MEDFILE_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MEDFILE_ROOT_DIR}/lib) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeMPI.cmake b/salome_adm/cmake_files/FindSalomeMPI.cmake index a12c163f9..8741b5df0 100644 --- a/salome_adm/cmake_files/FindSalomeMPI.cmake +++ b/salome_adm/cmake_files/FindSalomeMPI.cmake @@ -30,4 +30,8 @@ MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY) SET(MPI_INCLUDE_DIRS ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH}) SET(MPI_LIBRARIES ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES}) -SALOME_ACCUMULATE_HEADERS(MPI_INCLUDE_DIRS) +IF(MPI_FOUND) + SALOME_ACCUMULATE_HEADERS(MPI_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${MPI_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MPI_ROOT_DIR}/lib) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeOmniORB.cmake b/salome_adm/cmake_files/FindSalomeOmniORB.cmake index b7ec2d984..bddee88bb 100644 --- a/salome_adm/cmake_files/FindSalomeOmniORB.cmake +++ b/salome_adm/cmake_files/FindSalomeOmniORB.cmake @@ -26,4 +26,10 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OmniORB OMNIORB_INCLUDE_DIR 1) #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(OMNIORB_INCLUDE_DIR) \ No newline at end of file +IF(OMNIORB_FOUND) + SALOME_ACCUMULATE_HEADERS(OMNIORB_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${OMNIORB_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OMNIORB_ROOT_DIR}/lib) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${OMNIORB_ROOT_DIR}/lib + ${OMNIORB_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake b/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake index 3e4a0c493..08d85ceed 100644 --- a/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake +++ b/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake @@ -48,3 +48,10 @@ ELSE() MESSAGE(STATUS "OmniORB Python backend needs OmniORB, and OmniORB was not found!") ENDIF() ENDIF() + +IF(SalomeOmniORB_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${OMNIORB_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OMNIORB_ROOT_DIR}/lib) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${OMNIORB_ROOT_DIR}/lib + ${OMNIORB_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomePThread.cmake b/salome_adm/cmake_files/FindSalomePThread.cmake index 70639b708..19964adb7 100644 --- a/salome_adm/cmake_files/FindSalomePThread.cmake +++ b/salome_adm/cmake_files/FindSalomePThread.cmake @@ -26,4 +26,8 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PThread PTHREAD_INCLUDE_DIR 1) MARK_AS_ADVANCED(PTHREAD_LIBRARIES PTHREAD_INCLUDE_DIR) -SALOME_ACCUMULATE_HEADERS(PTHREAD_INCLUDE_DIR) +IF(SALOMEPTHREAD_FOUND) + SALOME_ACCUMULATE_HEADERS(PTHREAD_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PTHREAD_LIBRARIES}) +ENDIF() + diff --git a/salome_adm/cmake_files/FindSalomePaco.cmake b/salome_adm/cmake_files/FindSalomePaco.cmake index b47bf8ebf..9026f0116 100644 --- a/salome_adm/cmake_files/FindSalomePaco.cmake +++ b/salome_adm/cmake_files/FindSalomePaco.cmake @@ -25,3 +25,10 @@ # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Paco PACO_INCLUDE_DIRS 1) #MARK_AS_ADVANCED() + +IF(SALOMEPACO_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PACO_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PACO_ROOT_DIR}/lib) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PACO_ROOT_DIR}/lib + ${PACO_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomePython.cmake b/salome_adm/cmake_files/FindSalomePython.cmake index 89c4eb6fd..c775e0163 100644 --- a/salome_adm/cmake_files/FindSalomePython.cmake +++ b/salome_adm/cmake_files/FindSalomePython.cmake @@ -173,6 +173,9 @@ ELSE() MESSAGE(STATUS "Python was only partially (or not at all) found .") ENDIF() - -#SALOME_ACCUMULATE_HEADERS(PYTHON_INCLUDE_DIR) - +IF(SALOMEPYTHON_FOUND) + #SALOME_ACCUMULATE_HEADERS(PYTHON_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYTHON_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYTHON_ROOT_DIR}/lib) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYTHON_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeSIMANIO.cmake b/salome_adm/cmake_files/FindSalomeSIMANIO.cmake index 2391f490a..0a36c8407 100644 --- a/salome_adm/cmake_files/FindSalomeSIMANIO.cmake +++ b/salome_adm/cmake_files/FindSalomeSIMANIO.cmake @@ -27,4 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SIMANIO SIMANIO_INCLUDE_DIR 1) #MARK_AS_ADVANCED() -SALOME_ACCUMULATE_HEADERS(SIMANIO_INCLUDE_DIR) \ No newline at end of file +IF(SIMANIO_FOUND) + SALOME_ACCUMULATE_HEADERS(SIMANIO_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SIMANIO_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeSWIG.cmake b/salome_adm/cmake_files/FindSalomeSWIG.cmake index 80c7b6595..85786497d 100644 --- a/salome_adm/cmake_files/FindSalomeSWIG.cmake +++ b/salome_adm/cmake_files/FindSalomeSWIG.cmake @@ -25,3 +25,7 @@ # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2) MARK_AS_ADVANCED(SWIG_EXECUTABLE SWIG_VERSION) + +IF(SWIG_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SWIG_ROOT_DIR}/bin) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeSphinx.cmake b/salome_adm/cmake_files/FindSalomeSphinx.cmake index 2d26445a9..e1a95474b 100644 --- a/salome_adm/cmake_files/FindSalomeSphinx.cmake +++ b/salome_adm/cmake_files/FindSalomeSphinx.cmake @@ -44,3 +44,11 @@ ELSE() ENDIF() MARK_AS_ADVANCED(SPHINX_EXECUTABLE) + +IF(SPHINX_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYTHON_ROOT_DIR}/lib) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SPHINX_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages + ${SETUPTOOLS_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages + ${DOCUTILS_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeVTK.cmake b/salome_adm/cmake_files/FindSalomeVTK.cmake index 452ac9b4f..24fe201c3 100644 --- a/salome_adm/cmake_files/FindSalomeVTK.cmake +++ b/salome_adm/cmake_files/FindSalomeVTK.cmake @@ -54,9 +54,17 @@ ENDIF() SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(VTK VTK_INCLUDE_DIRS 2) MARK_AS_ADVANCED(VTK_DIR) -SALOME_ACCUMULATE_HEADERS(VTK_INCLUDE_DIRS) - IF(VTK_FOUND) MESSAGE(STATUS "VTK version is ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") #MESSAGE(STATUS "VTK libraries are: ${VTK_LIBRARIES}") ENDIF() + +IF(VTK_FOUND) + SALOME_ACCUMULATE_HEADERS(VTK_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PARAVIEW_ROOT_DIR}/bin) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PARAVIEW_ROOT_DIR}/lib/paraview-3.98) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PARAVIEW_ROOT_DIR}/lib/paraview-3.98 + ${PARAVIEW_ROOT_DIR}/lib/paraview-3.98/site-packages + ${PARAVIEW_ROOT_DIR}/lib/paraview-3.98/site-packages/paraview) + SALOME_ACCUMULATE_ENVIRONMENT(PV_PLUGIN_PATH ${PARAVIEW_ROOT_DIR}/lib/paraview-3.98) +ENDIF()