diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2016-07-12 19:32:10 (GMT) |
---|---|---|
committer | Chuck Atkins <chuck.atkins@kitware.com> | 2016-07-12 19:32:10 (GMT) |
commit | d5e4516ec279318d3c639cda2f20149f0a588220 (patch) | |
tree | 9110ed2f9fb5a33a6952448f9184d49d99d9ce1e /Modules | |
parent | 4ece8bdd0fa36d8e69dabf8c620f9e50170000e8 (diff) | |
download | CMake-d5e4516ec279318d3c639cda2f20149f0a588220.zip CMake-d5e4516ec279318d3c639cda2f20149f0a588220.tar.gz CMake-d5e4516ec279318d3c639cda2f20149f0a588220.tar.bz2 |
FindHDF5: Cleanup inconsistent use of HDF5_ROOT
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindHDF5.cmake | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index a81ba13..50e1892 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -378,6 +378,10 @@ macro( _HDF5_parse_compile_line endforeach() endmacro() +if(NOT HDF5_ROOT) + set(HDF5_ROOT $ENV{HDF5_ROOT}) +endif() + # Try to find HDF5 using an installed hdf5-config.cmake if(NOT HDF5_FOUND AND NOT HDF5_ROOT) find_package(HDF5 QUIET NO_MODULE) @@ -478,7 +482,6 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) # search options with the wrapper find_program(HDF5_${__lang}_COMPILER_EXECUTABLE NAMES ${HDF5_${__lang}_COMPILER_NAMES} NAMES_PER_DIR - HINTS ENV HDF5_ROOT PATH_SUFFIXES bin Bin DOC "HDF5 ${__lang} Wrapper compiler. Used only to detect HDF5 compile flags." ) @@ -590,10 +593,14 @@ elseif(NOT HDF5_FOUND AND NOT _HDF5_NEED_TO_SEARCH) endif() endif() +if(HDF5_ROOT) + set(SEARCH_OPTS NO_DEFAULT_PATH) +endif() find_program( HDF5_DIFF_EXECUTABLE NAMES h5diff - HINTS ENV HDF5_ROOT + HINTS ${HDF5_ROOT} PATH_SUFFIXES bin Bin + ${SEARCH_OPTS} DOC "HDF5 file differencing tool." ) mark_as_advanced( HDF5_DIFF_EXECUTABLE ) @@ -608,9 +615,6 @@ if( NOT HDF5_FOUND ) set(HDF5_Fortran_LIBRARY_NAMES hdf5_fortran ${HDF5_C_LIBRARY_NAMES}) set(HDF5_Fortran_HL_LIBRARY_NAMES hdf5_hl_fortran ${HDF5_C_HL_LIBRARY_NAMES} ${HDF5_Fortran_LIBRARY_NAMES}) - if(HDF5_ROOT) - set(SEARCH_OPTS NO_DEFAULT_PATH) - endif() foreach(__lang IN LISTS HDF5_LANGUAGE_BINDINGS) # find the HDF5 include directories if(LANGUAGE STREQUAL "Fortran") @@ -622,7 +626,7 @@ if( NOT HDF5_FOUND ) endif() find_path(HDF5_${__lang}_INCLUDE_DIR ${HDF5_INCLUDE_FILENAME} - HINTS ${HDF5_ROOT} ENV HDF5_ROOT + HINTS ${HDF5_ROOT} PATHS $ENV{HOME}/.local/include PATH_SUFFIXES include Include ${SEARCH_OPTS} @@ -648,12 +652,12 @@ if( NOT HDF5_FOUND ) endif() find_library(HDF5_${LIB}_LIBRARY_DEBUG NAMES ${THIS_LIBRARY_SEARCH_DEBUG} - HINTS ${HDF5_ROOT} ENV HDF5_ROOT PATH_SUFFIXES lib Lib + HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib ${SEARCH_OPTS} ) find_library( HDF5_${LIB}_LIBRARY_RELEASE NAMES ${THIS_LIBRARY_SEARCH_RELEASE} - HINTS ${HDF5_ROOT} ENV HDF5_ROOT PATH_SUFFIXES lib Lib + HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib ${SEARCH_OPTS} ) select_library_configurations( HDF5_${LIB} ) @@ -685,12 +689,12 @@ if( NOT HDF5_FOUND ) endif() find_library(HDF5_${LIB}_LIBRARY_DEBUG NAMES ${THIS_LIBRARY_SEARCH_DEBUG} - HINTS ${HDF5_ROOT} ENV HDF5_ROOT PATH_SUFFIXES lib Lib + HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib ${SEARCH_OPTS} ) find_library( HDF5_${LIB}_LIBRARY_RELEASE NAMES ${THIS_LIBRARY_SEARCH_RELEASE} - HINTS ${HDF5_ROOT} ENV HDF5_ROOT PATH_SUFFIXES lib Lib + HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib ${SEARCH_OPTS} ) select_library_configurations( HDF5_${LIB} ) |