From 9310d00822378e24dbd43849f9892d2f775ca3ff Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Mon, 24 Jul 2017 09:16:29 +0200 Subject: FindHDF5: for a static imported config, use CONFIG-specific library first check the LOCATION_ propertiy to find the library, then LOCATION --- Modules/FindHDF5.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index d3fd0ee..bbcfe75 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -495,7 +495,10 @@ if(NOT HDF5_FOUND AND NOT HDF5_NO_FIND_PACKAGE_CONFIG_FILE) get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} IMPORTED_IMPLIB_${_hdf5_imported_conf} ) if (NOT _lang_location) # no import lib, just try LOCATION - get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION) + get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION_${_hdf5_imported_conf}) + if (NOT _lang_location) + get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION) + endif() endif() if( _lang_location ) set(HDF5_${_lang}_LIBRARY ${_lang_location}) -- cgit v0.12