diff options
author | Brad King <brad.king@kitware.com> | 2015-09-14 13:20:01 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-09-14 13:20:01 (GMT) |
commit | f660a6890cdd8931d5f820f34d59ab9217a6d02b (patch) | |
tree | 35b9472d677a5fdd0db9a92494d3ddbbc6956c62 /Modules | |
parent | 31117bb17c4e764bb60b8c9c6847a631cc9ecf3c (diff) | |
parent | fd26a19afc24ac6ce62c4c31ec589c0d296f15de (diff) | |
download | CMake-f660a6890cdd8931d5f820f34d59ab9217a6d02b.zip CMake-f660a6890cdd8931d5f820f34d59ab9217a6d02b.tar.gz CMake-f660a6890cdd8931d5f820f34d59ab9217a6d02b.tar.bz2 |
Merge topic 'FindHDF5-updates'
fd26a19a FindHDF5: Add NAMES_PER_DIR and introduce HDF5_PREFER_PARALLEL
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindHDF5.cmake | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index a449132..37bca83 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -31,6 +31,12 @@ # Find module will then look in this path when searching for HDF5 # executables, paths, and libraries. # +# Both the serial and parallel HDF5 wrappers are considered and the first +# directory to contain either one will be used. In the event that both appear +# in the same directory the serial version is preferentially selected. This +# behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to +# true. +# # In addition to finding the includes and libraries required to compile # an HDF5 client application, this module also makes an effort to find # tools that come with the HDF5 distribution that may be useful for @@ -103,28 +109,43 @@ else() endforeach() endif() +# Determine whether to search for serial or parallel executable first +if(HDF5_PREFER_PARALLEL) + set(HDF5_C_COMPILER_NAMES h5pcc h5cc) + set(HDF5_CXX_COMPILER_NAMES h5pc++ h5c++) + set(HDF5_Fortran_COMPILER_NAMES h5pfc h5fc) +else() + set(HDF5_C_COMPILER_NAMES h5cc h5pcc) + set(HDF5_CXX_COMPILER_NAMES h5c++ h5pc++) + set(HDF5_Fortran_COMPILER_NAMES h5fc h5pfc) +endif() + # try to find the HDF5 wrapper compilers find_program( HDF5_C_COMPILER_EXECUTABLE - NAMES h5cc h5pcc + NAMES ${HDF5_C_COMPILER_NAMES} NAMES_PER_DIR HINTS ENV HDF5_ROOT PATH_SUFFIXES bin Bin DOC "HDF5 Wrapper compiler. Used only to detect HDF5 compile flags." ) mark_as_advanced( HDF5_C_COMPILER_EXECUTABLE ) find_program( HDF5_CXX_COMPILER_EXECUTABLE - NAMES h5c++ h5pc++ + NAMES ${HDF5_CXX_COMPILER_NAMES} NAMES_PER_DIR HINTS ENV HDF5_ROOT PATH_SUFFIXES bin Bin DOC "HDF5 C++ Wrapper compiler. Used only to detect HDF5 compile flags." ) mark_as_advanced( HDF5_CXX_COMPILER_EXECUTABLE ) find_program( HDF5_Fortran_COMPILER_EXECUTABLE - NAMES h5fc h5pfc + NAMES ${HDF5_Fortran_COMPILER_NAMES} NAMES_PER_DIR HINTS ENV HDF5_ROOT PATH_SUFFIXES bin Bin DOC "HDF5 Fortran Wrapper compiler. Used only to detect HDF5 compile flags." ) mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE ) +unset(HDF5_C_COMPILER_NAMES) +unset(HDF5_CXX_COMPILER_NAMES) +unset(HDF5_Fortran_COMPILER_NAMES) + find_program( HDF5_DIFF_EXECUTABLE NAMES h5diff HINTS ENV HDF5_ROOT @@ -378,4 +399,3 @@ find_package_handle_standard_args( HDF5 REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS VERSION_VAR HDF5_VERSION ) - |