diff options
author | Kris Thielemans <k.thielemans@ucl.ac.uk> | 2020-12-26 20:24:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-01-04 19:26:38 (GMT) |
commit | 5267ba9d63524479a11d71f7a4458cf95b8ef445 (patch) | |
tree | 306b0744c80e8f6702873985a87aa6e3adf58ae0 /Modules/FindHDF5.cmake | |
parent | 511158a03ba52c38b68e938704b07718dd3e6786 (diff) | |
download | CMake-5267ba9d63524479a11d71f7a4458cf95b8ef445.zip CMake-5267ba9d63524479a11d71f7a4458cf95b8ef445.tar.gz CMake-5267ba9d63524479a11d71f7a4458cf95b8ef445.tar.bz2 |
FindHDF5: Fix finding both debug and release libs
Use `target_link_libraries` to set `INTERFACE_LINK_LIBRARIES` so that
the `debug` and `optimized` keywords work.
In commit a8e0a6b3e4 (FindHDF5: Port changes from VTK, 2020-06-10,
v3.19.0-rc1~312^2~1) we added use of `HDF5_LIBRARIES`, but the value may
contain `debug` and `optimized` keywords.
Fixes: #21637
Diffstat (limited to 'Modules/FindHDF5.cmake')
-rw-r--r-- | Modules/FindHDF5.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 0c1e93b..25f5a1f 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -991,10 +991,10 @@ if (HDF5_FOUND) add_library(HDF5::HDF5 INTERFACE IMPORTED) string(REPLACE "-D" "" _hdf5_definitions "${HDF5_DEFINITIONS}") set_target_properties(HDF5::HDF5 PROPERTIES - INTERFACE_LINK_LIBRARIES "${HDF5_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIRS}" INTERFACE_COMPILE_DEFINITIONS "${_hdf5_definitions}") unset(_hdf5_definitions) + target_link_libraries(HDF5::HDF5 INTERFACE ${HDF5_LIBRARIES}) endif () foreach (hdf5_lang IN LISTS HDF5_LANGUAGE_BINDINGS) |