diff options
author | Brad King <brad.king@kitware.com> | 2020-12-02 14:21:53 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-02 14:22:52 (GMT) |
commit | 79077df26bba901944bc2fbeed2d43effb58e51c (patch) | |
tree | 27178263af3695568982a6f522db4572f92cfbde /Modules | |
parent | 859ecbe4462c1c0da4fbd258d8bbe8e4cdd25974 (diff) | |
parent | 175beadd4c3ba6b3e3a2f266a6643f217d39e32e (diff) | |
download | CMake-79077df26bba901944bc2fbeed2d43effb58e51c.zip CMake-79077df26bba901944bc2fbeed2d43effb58e51c.tar.gz CMake-79077df26bba901944bc2fbeed2d43effb58e51c.tar.bz2 |
Merge topic 'FindHDF5-hdf5hl_fortran-variable' into release-3.19
175beadd4c FindHDF5: support the hdf5hl_fortran-based variable names
adf108441e FindHDF5: improve error messages when a location variable isn't known
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5563
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindHDF5.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 0a92c71..0c1e93b 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -1026,7 +1026,7 @@ if (HDF5_FOUND) # Error if we still don't have the location. message(SEND_ERROR "HDF5 was found, but a different variable was set which contains " - "its location.") + "the location of the `hdf5::${hdf5_target_name}` library.") endif () add_library("hdf5::${hdf5_target_name}" UNKNOWN IMPORTED) string(REPLACE "-D" "" _hdf5_definitions "${HDF5_${hdf5_lang}_DEFINITIONS}") @@ -1057,12 +1057,14 @@ if (HDF5_FOUND) continue () endif () + set(hdf5_alt_target_name "") if (hdf5_lang STREQUAL "C") set(hdf5_target_name "hdf5_hl") elseif (hdf5_lang STREQUAL "CXX") set(hdf5_target_name "hdf5_hl_cpp") elseif (hdf5_lang STREQUAL "Fortran") set(hdf5_target_name "hdf5_hl_fortran") + set(hdf5_alt_target_name "hdf5hl_fortran") else () continue () endif () @@ -1081,11 +1083,13 @@ if (HDF5_FOUND) set(_hdf5_location "${HDF5_${hdf5_lang}_HL_LIBRARY}") elseif (DEFINED "HDF5_${hdf5_lang}_LIBRARY_${hdf5_target_name}") set(_hdf5_location "${HDF5_${hdf5_lang}_LIBRARY_${hdf5_target_name}}") + elseif (hdf5_alt_target_name AND DEFINED "HDF5_${hdf5_lang}_LIBRARY_${hdf5_alt_target_name}") + set(_hdf5_location "${HDF5_${hdf5_lang}_LIBRARY_${hdf5_alt_target_name}}") else () # Error if we still don't have the location. message(SEND_ERROR "HDF5 was found, but a different variable was set which contains " - "its location.") + "the location of the `hdf5::${hdf5_target_name}` library.") endif () add_library("hdf5::${hdf5_target_name}" UNKNOWN IMPORTED) string(REPLACE "-D" "" _hdf5_definitions "${HDF5_${hdf5_lang}_HL_DEFINITIONS}") |