]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Synchronize adm files
authorinv <inv@opencascade.com>
Tue, 29 Oct 2013 17:15:27 +0000 (17:15 +0000)
committerinv <inv@opencascade.com>
Tue, 29 Oct 2013 17:15:27 +0000 (17:15 +0000)
12 files changed:
adm_local_without_kernel/cmake_files/FindSalomeBoost.cmake
adm_local_without_kernel/cmake_files/FindSalomeCppUnit.cmake
adm_local_without_kernel/cmake_files/FindSalomeDoxygen.cmake
adm_local_without_kernel/cmake_files/FindSalomeGraphviz.cmake
adm_local_without_kernel/cmake_files/FindSalomeHDF5.cmake
adm_local_without_kernel/cmake_files/FindSalomeLibXml2.cmake
adm_local_without_kernel/cmake_files/FindSalomeMEDFile.cmake
adm_local_without_kernel/cmake_files/FindSalomeMPI.cmake
adm_local_without_kernel/cmake_files/FindSalomePython.cmake
adm_local_without_kernel/cmake_files/FindSalomeSWIG.cmake
adm_local_without_kernel/cmake_files/FindSalomeSphinx.cmake
adm_local_without_kernel/cmake_files/SalomeMacros.cmake

index 5deff116dad991323ded2dd8f582100063e2a7d9..f257672188c8c315db2a9e7fbcd5de2971c9cd13 100644 (file)
@@ -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
index e8a5527e9c8c3f77cdee84b7d51d75dffa874b31..9e20e145fe21738bc26e4d625d2330c130ddb27a 100644 (file)
@@ -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()
index b217886d34ce9708c59a941e1f8dde43a24f02c4..511d81bc44da30bb0d5b5c3fdd16fa16cb10493c 100644 (file)
@@ -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()
index e355263b1b229ab371959decd9954b8843e88c3a..bbefabff2d164ede5264b6ac50fab37633f15467 100644 (file)
@@ -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
index c6460a944104d631640f746eec4bc20f922dcd4f..de7dc234d9365734cdeab4b15f1042c21db88ca2 100644 (file)
@@ -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()
index c736b2e6307b4e074604e36d0b2c12ca77b8fcdf..60c4dbcd546b111a2d62cbbd25519d72f93efa85 100644 (file)
@@ -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()
index b53e057b5fa91e49c5af95d2e8eaa3ce7eea7645..9777406b2923b86e62fbeb093dd1a96ac312216c 100644 (file)
@@ -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
index a12c163f92c93f17ba505186431c97acb42d2e12..8741b5df0522412309b83c11bbdc104e19161339 100644 (file)
@@ -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()
index 89c4eb6fd1a01b3608f43764b07e887d3a5a11a6..c775e0163e47a143033141dbf941ad46a28c2100 100644 (file)
@@ -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()
index 80c7b6595566e4a672eb0389bd13f8f155bd7973..85786497d7ea2831f0517992aba116013ded541e 100644 (file)
@@ -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()
index 2d26445a94049cc50a1be995b63b97d1a18ea949..e1a95474bbc9a2ece2c91825a7b7ac3512eac0eb 100644 (file)
@@ -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()
index 75c291ffdbe66f3365524cf5134e4a575af1e991..4d1bc6a1bdd4e4f9feb74b728dc627e170307680 100755 (executable)
@@ -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_<var>
-# where <var> is name of variable.
+#    _${PROJECT_NAME}_EXTRA_ENV_<var>, where <var> 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_<var>, where <var> is name of variable and
+# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT);
+# and puts generated command in proper environment into <output> argument.
+# 
+# Notes:
+# - If <script> is specified as relative path, it is computed from the current build
+#   directory.
+#
+MACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT output script cmd opts)
+  IF(IS_ABSOLUTE ${script})
+    SET(_script ${script})
+  ELSE()
+    SET(_script ${CMAKE_CURRENT_BINARY_DIR}/${script})
+  ENDIF()
+
+  SET(_env)
+  FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+    FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})
+      IF(WIN32)
+        IF(${_item} STREQUAL "LD_LIBRARY_PATH")
+          SET(_item PATH)
+        ENDIF()
+        STRING(REPLACE "/" "\\" _env "${_env} @SET ${_item}=${_val}\;%${_item}%\n")
+        SET(_ext "bat")
+        SET(_call_cmd "call")
+      ELSE(WIN32)
+        SET(_env "${_env} export ${_item}=${_val}:\${${_item}}\n")
+        SET(_ext "sh")
+        SET(_call_cmd ".")
+      ENDIF(WIN32)
+    ENDFOREACH()
+  ENDFOREACH()
+  
+  SET(_script ${_script}.${_ext})
+  FILE(WRITE ${_script} "${_env}")
+  
+  SET(${output} ${_call_cmd} ${_script} && ${cmd} ${opts})
+  
+ENDMACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT)
 
 #########################################################################
 # SALOME_APPEND_LIST_OF_LIST()
@@ -721,5 +782,4 @@ MACRO(SALOME_CONFIGURE_PREPARE)
       SALOME_APPEND_LIST_OF_LIST(_PREREQ_COMPO_LIST Salome${_prereq}_COMPONENTS)
     ENDIF()
   ENDFOREACH()
-ENDMACRO(SALOME_CONFIGURE_PREPARE)
-
+ENDMACRO(SALOME_CONFIGURE_PREPARE)
\ No newline at end of file