]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Synchronize adm files
authorinv <inv@opencascade.com>
Wed, 30 Oct 2013 17:12:28 +0000 (17:12 +0000)
committerinv <inv@opencascade.com>
Wed, 30 Oct 2013 17:12:28 +0000 (17:12 +0000)
adm_local_without_kernel/cmake_files/FindGraphviz.cmake
adm_local_without_kernel/cmake_files/FindSalomeBoost.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/FindSalomeSWIG.cmake
adm_local_without_kernel/cmake_files/FindSphinx.cmake
adm_local_without_kernel/cmake_files/SalomeMacros.cmake

index 1398eb6b7195d65d5ce9d452c217b17c431e091c..6eb1e5a71767dde06bb1fcac0053cc285629a88f 100644 (file)
@@ -34,11 +34,11 @@ FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot)
 FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/graph.h)
 SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz)
 
-FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY      NAMES cdt)
-FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph)
-FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY    NAMES graph)
-FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY      NAMES gvc)
-FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan)
+FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY      NAMES cdt PATH_SUFFIXES bin)
+FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph PATH_SUFFIXES bin)
+FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY    NAMES graph PATH_SUFFIXES bin)
+FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY      NAMES gvc PATH_SUFFIXES bin)
+FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin)
 
 SET(GRAPHVIZ_LIBRARIES 
   ${GRAPHVIZ_cdt_LIBRARY}
index f257672188c8c315db2a9e7fbcd5de2971c9cd13..df3d85464b121fe1da106652592e45c63f6a9a30 100644 (file)
@@ -47,6 +47,5 @@ ENDIF()
 
 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)
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Boost_LIBRARIES})
 ENDIF()
\ No newline at end of file
index 511d81bc44da30bb0d5b5c3fdd16fa16cb10493c..9da127e35ee62aae8760a7369100863e1ddf6100 100644 (file)
@@ -40,5 +40,5 @@ ENDIF()
 MARK_AS_ADVANCED(DOXYGEN_SUPPORT_STL)
 
 IF(DOXYGEN_FOUND)
-  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${DOXYGEN_ROOT_DIR}/bin)
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${DOXYGEN_EXECUTABLE})
 ENDIF()
index bbefabff2d164ede5264b6ac50fab37633f15467..ad3c3c4991e780b02f82caef53ec54d7170d8996 100644 (file)
@@ -28,7 +28,6 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Graphviz GRAPHVIZ_EXECUTABLE GRAPHVIZ_L
 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)
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${GRAPHVIZ_EXECUTABLE})
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${GRAPHVIZ_LIBRARIES})
 ENDIF()
\ No newline at end of file
index de7dc234d9365734cdeab4b15f1042c21db88ca2..6b227faf77ffbfe9918c04467b8fcad005fafdca 100644 (file)
 #  MPI root directory used for HDF5 compilation is exposed into MPI_ROOT_DIR_EXP
 #
 
+SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to the HDF5.")
+
 if(WIN32)
   set(PREV_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
   set(CMAKE_FIND_LIBRARY_SUFFIXES dll${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  set(CMAKE_LIBRARY_PATH ${HDF5_ROOT_DIR}/dll)
 endif()
 
 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(HDF5 HDF5_INCLUDE_DIR 1)
@@ -86,6 +89,5 @@ 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)
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${HDF5_LIBRARIES})
 ENDIF()
index 60c4dbcd546b111a2d62cbbd25519d72f93efa85..4c760e16292f33fdba89a9d74a6ba9d9506437ca 100644 (file)
@@ -30,6 +30,5 @@ ENDIF()
 
 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)
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${LIBXML2_LIBRARIES})
 ENDIF()
index 9777406b2923b86e62fbeb093dd1a96ac312216c..7180826e2582dde57ed5430e56f13cbc60308c63 100644 (file)
@@ -29,6 +29,5 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(MEDFile MEDFILE_INCLUDE_DIRS 1)
 
 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)
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MEDFILE_LIBRARIES})
 ENDIF()
\ No newline at end of file
index 8741b5df0522412309b83c11bbdc104e19161339..4a5dbaaaa35a9e86ffcc7022f1281a0f5c9b2e20 100644 (file)
@@ -32,6 +32,5 @@ SET(MPI_LIBRARIES ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES})
 
 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)
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MPI_LIBRARIES})
 ENDIF()
index 85786497d7ea2831f0517992aba116013ded541e..8d2cb42c4f7efbddd276098c6b245b352faa400e 100644 (file)
@@ -27,5 +27,5 @@ 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)
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SWIG_EXECUTABLE})
 ENDIF()
index 8e05c7a73c21330b913c249bb7405651e6ffd72c..f06933ab1a3a66db0e34040ee0966b5fa091dbca 100644 (file)
@@ -30,7 +30,7 @@
 #
 ###########################################################################
 
-FIND_PROGRAM(SPHINX_EXECUTABLE sphinx-build)
+FIND_PROGRAM(SPHINX_EXECUTABLE sphinx-build PATH_SUFFIXES Scripts)
 
 # Handle the standard arguments of the find_package() command:
 INCLUDE(FindPackageHandleStandardArgs)
index 4d1bc6a1bdd4e4f9feb74b728dc627e170307680..658e3f688a0fa8b78566a29f79360fcb4b264ec1 100755 (executable)
@@ -655,23 +655,49 @@ ENDMACRO(SALOME_ACCUMULATE_HEADERS)
 # 2. Full list of environment variable names is stored in CMake variable
 #    _${PROJECT_NAME}_EXTRA_ENV.
 #
+# Notes:
+# - The arguments list can include optional CHECK or NOCHECK keywords:
+#   * For all arguments following CHECK keyword the macro perform an
+#     additional check (see below); this is the default mode, it is suitable
+#     for path variables (PATH, LD_LIBRARY_PATH, etc).
+#   * For all arguments following NOCHECK keyword, no additional check is
+#     performed.
+#   Checking an argument means that we check:
+#    - That the path actually exists
+#    - That this is not a standard system path (starting with "/usr"); this avoids
+#   polluting LD_LIBRARY_PATH or PATH with things like "/usr/lib64" ...
+#
 MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar)
+  SET(_is_check ON)
   FOREACH(_item ${ARGN})
-    IF(EXISTS ${_item})
-      IF(IS_DIRECTORY ${_item})
+    IF(${_item} STREQUAL "NOCHECK")
+      SET(_is_check OFF)
+    ELSEIF(${_item} STREQUAL "CHECK")
+      SET(_is_check ON)
+    ELSE()
+      IF(_is_check)
+        IF(NOT IS_DIRECTORY ${_item})
+          IF(TARGET ${_item})
+            GET_TARGET_PROPERTY(_item ${_item} LOCATION)
+          ENDIF()        
+          GET_FILENAME_COMPONENT(_item ${_item} PATH)  
+        ENDIF()    
+        IF(EXISTS ${_item})
+          STRING(REGEX MATCH "^/usr" _usr_find ${_item})
+          LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)
+          IF(NOT _usr_find AND _res EQUAL -1)
+              LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item})
+          ENDIF()  
+        ENDIF()
+      ELSE(_is_check)
         LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)
-        IF(_res EQUAL -1)
+        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()
+        ENDIF()  
+      ENDIF(_is_check)
+    ENDIF()   
   ENDFOREACH()
+  
   LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res)
   IF(_res EQUAL -1)
     LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV ${envvar})
@@ -717,7 +743,7 @@ MACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT output script cmd opts)
         IF(${_item} STREQUAL "LD_LIBRARY_PATH")
           SET(_item PATH)
         ENDIF()
-        STRING(REPLACE "/" "\\" _env "${_env} @SET ${_item}=${_val}\;%${_item}%\n")
+        STRING(REPLACE "/" "\\" _env "${_env} @SET ${_item}=${_val};%${_item}%\n")
         SET(_ext "bat")
         SET(_call_cmd "call")
       ELSE(WIN32)