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}
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
MARK_AS_ADVANCED(DOXYGEN_SUPPORT_STL)
IF(DOXYGEN_FOUND)
- SALOME_ACCUMULATE_ENVIRONMENT(PATH ${DOXYGEN_ROOT_DIR}/bin)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${DOXYGEN_EXECUTABLE})
ENDIF()
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
# 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)
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()
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()
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
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()
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()
#
###########################################################################
-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)
# 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})
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)