FindHDF5: do not cache library locations when using hdf5-config.cmake

The imported targets provide a persistent reference of their location,
so we do not need to cache the values.
This commit is contained in:
Kris Thielemans
2017-02-06 01:27:56 +00:00
committed by Brad King
parent bf67fff035
commit 003c91385a

View File

@@ -439,9 +439,7 @@ if(NOT HDF5_FOUND)
get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION)
if( _lang_location )
set(HDF5_${_lang}_LIBRARY ${_lang_location} CACHE PATH
"HDF5 ${_lang} library" )
mark_as_advanced(HDF5_${_lang}_LIBRARY)
set(HDF5_${_lang}_LIBRARY ${_lang_location})
list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix})
set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix})
set(HDF5_${_lang}_FOUND True)
@@ -449,9 +447,7 @@ if(NOT HDF5_FOUND)
if(FIND_HL)
get_target_property(_lang_hl_location ${HDF5_${_lang}_HL_TARGET}${_suffix} LOCATION)
if( _lang_hl_location )
set(HDF5_${_lang}_HL_LIBRARY ${_lang_hl_location} CACHE PATH
"HDF5 ${_lang} HL library" )
mark_as_advanced(HDF5_${_lang}_HL_LIBRARY)
set(HDF5_${_lang}_HL_LIBRARY ${_lang_hl_location})
list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix})
set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix})
set(HDF5_HL_FOUND True)