From: inv Date: Tue, 29 Oct 2013 17:15:27 +0000 (+0000) Subject: Synchronize adm files X-Git-Tag: V7_3_0a1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a21438cea3f4e97c96cf5d257e6ec576bd06df5b;p=modules%2Fmed.git Synchronize adm files --- diff --git a/adm_local_without_kernel/cmake_files/FindSalomeBoost.cmake b/adm_local_without_kernel/cmake_files/FindSalomeBoost.cmake index 5deff116d..f25767218 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeBoost.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeCppUnit.cmake b/adm_local_without_kernel/cmake_files/FindSalomeCppUnit.cmake index e8a5527e9..9e20e145f 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeCppUnit.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeDoxygen.cmake b/adm_local_without_kernel/cmake_files/FindSalomeDoxygen.cmake index b217886d3..511d81bc4 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeDoxygen.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeGraphviz.cmake b/adm_local_without_kernel/cmake_files/FindSalomeGraphviz.cmake index e355263b1..bbefabff2 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeGraphviz.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeHDF5.cmake b/adm_local_without_kernel/cmake_files/FindSalomeHDF5.cmake index c6460a944..de7dc234d 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeHDF5.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeLibXml2.cmake b/adm_local_without_kernel/cmake_files/FindSalomeLibXml2.cmake index c736b2e63..60c4dbcd5 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeLibXml2.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeMEDFile.cmake b/adm_local_without_kernel/cmake_files/FindSalomeMEDFile.cmake index b53e057b5..9777406b2 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeMEDFile.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeMPI.cmake b/adm_local_without_kernel/cmake_files/FindSalomeMPI.cmake index a12c163f9..8741b5df0 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeMPI.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomePython.cmake b/adm_local_without_kernel/cmake_files/FindSalomePython.cmake index 89c4eb6fd..c775e0163 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomePython.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeSWIG.cmake b/adm_local_without_kernel/cmake_files/FindSalomeSWIG.cmake index 80c7b6595..85786497d 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeSWIG.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/FindSalomeSphinx.cmake b/adm_local_without_kernel/cmake_files/FindSalomeSphinx.cmake index 2d26445a9..e1a95474b 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomeSphinx.cmake +++ b/adm_local_without_kernel/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/adm_local_without_kernel/cmake_files/SalomeMacros.cmake b/adm_local_without_kernel/cmake_files/SalomeMacros.cmake index 75c291ffd..4d1bc6a1b 100755 --- a/adm_local_without_kernel/cmake_files/SalomeMacros.cmake +++ b/adm_local_without_kernel/cmake_files/SalomeMacros.cmake @@ -640,27 +640,36 @@ ENDMACRO(SALOME_ACCUMULATE_HEADERS) ######################################################################### # SALOME_ACCUMULATE_ENVIRONMENT() # -# USAGE: SALOME_ACCUMULATE_ENVIRONMENT(var value) +# USAGE: SALOME_ACCUMULATE_ENVIRONMENT(envvar value [value ...]) # # ARGUMENTS: -# var [in] environment variable name, e.g. PATH -# value [in] value(s) to be added to environment variable +# envvar [in] environment variable name, e.g. PATH +# value [in] value(s) to be added to environment variable # # This macro is called in the various FindSalomeXYZ.cmake modules to # accumulate environment variables, to be used later to run some command # in proper environment. # # 1. Each envrironment variable is stored in specific CMake variable -# _${PROJECT_NAME}_EXTRA_ENV_ -# where is name of variable. +# _${PROJECT_NAME}_EXTRA_ENV_, where is name of variable. # 2. Full list of environment variable names is stored in CMake variable -# _${PROJECT_NAME}_EXTRA_ENV. -# -MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar val) - FOREACH(_item ${val}) - LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) - IF(_res EQUAL -1) - LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) +# _${PROJECT_NAME}_EXTRA_ENV. +# +MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar) + FOREACH(_item ${ARGN}) + IF(EXISTS ${_item}) + IF(IS_DIRECTORY ${_item}) + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) + IF(_res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) + ENDIF() + ELSE() + GET_FILENAME_COMPONENT(_path_dir ${_item} PATH) + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_path_dir} _res) + IF(_res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_path_dir}) + ENDIF() + ENDIF() ENDIF() ENDFOREACH() LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res) @@ -673,6 +682,58 @@ MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar val) ENDFOREACH() ENDMACRO(SALOME_ACCUMULATE_ENVIRONMENT) +######################################################################### +# SALOME_GENERATE_ENVIRONMENT_SCRIPT() +# +# USAGE: SALOME_GENERATE_ENVIRONMENT_SCRIPT(output script cmd opts) +# +# ARGUMENTS: +# output [out] output command, e.g. for creation of target. +# script [in] output environement script name +# cmd [in] input command, e.g. sphinx or python command. +# opts [in] options for input command (cmd). +# +# This macro is called when it's necessary to use given environment to run some command. +# Macro generates environement script using previously created variables +# _${PROJECT_NAME}_EXTRA_ENV_, where is name of variable and +# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT); +# and puts generated command in proper environment into argument. +# +# Notes: +# - If