From b5bc72574e6e63bb349b3c0b59397446942722a1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 27 Jun 2022 13:50:15 -0400 Subject: FindHDF5: Revert "Add explicit library location instead of guessed ..." Revert commit e4e309f165 (FindHDF5: Add explicit library location instead of guessed library name., 2022-03-22, v3.24.0-rc1~375^2). The old behavior was not a guessed library name, but the name of an imported target that can contain per-config locations and encode usage requirements. Although find modules do not normally return their imported target names in the `_LIBRARIES` variable, FindHDF5 has done so since commit 5201a3065b (FindHDF5: use the target rather than the path, 2017-01-04, v3.8.0-rc1~81^2). Fixes: #23667 --- Modules/FindHDF5.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 46ad015..40ed9a9 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -555,8 +555,8 @@ if(NOT HDF5_FOUND AND NOT HDF5_NO_FIND_PACKAGE_CONFIG_FILE) endif() if( _hdf5_lang_location ) set(HDF5_${_lang}_LIBRARY ${_hdf5_lang_location}) - list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_LIBRARY}) - set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_LIBRARY}) + list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix}) + set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix}) set(HDF5_${_lang}_FOUND TRUE) endif() if(HDF5_FIND_HL) @@ -569,8 +569,8 @@ if(NOT HDF5_FOUND AND NOT HDF5_NO_FIND_PACKAGE_CONFIG_FILE) endif() if( _hdf5_lang_hl_location ) set(HDF5_${_lang}_HL_LIBRARY ${_hdf5_lang_hl_location}) - list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY}) - set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY}) + list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_HL_TARGET}${_suffix}) + set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_HL_TARGET}${_suffix}) set(HDF5_HL_FOUND TRUE) endif() unset(_hdf5_lang_hl_location) -- cgit v0.12