summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-01 15:35:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-02-01 15:35:32 (GMT)
commit6bbbd42e19668af9b1c2c823baf2ca95ade7ae43 (patch)
tree11df7d745292bab662ea06b2981e159b447bb508
parent9d439dfd1b7f8599905e687005dd8dc69921f4d2 (diff)
parentdb9d911db02b79228a058da852a3419570cdce0c (diff)
downloadCMake-6bbbd42e19668af9b1c2c823baf2ca95ade7ae43.zip
CMake-6bbbd42e19668af9b1c2c823baf2ca95ade7ae43.tar.gz
CMake-6bbbd42e19668af9b1c2c823baf2ca95ade7ae43.tar.bz2
Merge topic 'FindHDF5-imported-per-config'
db9d911db0 FindHDF5: Set config-specific locations for imported targets d28e5263fe FindHDF5: Drop IMPORTED_IMPLIB property from imported UNKNOWN libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6931
-rw-r--r--Modules/FindHDF5.cmake46
1 files changed, 42 insertions, 4 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 6e07da5..9123d56 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -1050,8 +1050,12 @@ if (HDF5_FOUND)
else()
if (DEFINED "HDF5_${hdf5_target_name}_LIBRARY")
set(_hdf5_location "${HDF5_${hdf5_target_name}_LIBRARY}")
+ set(_hdf5_location_release "${HDF5_${hdf5_target_name}_LIBRARY_RELEASE}")
+ set(_hdf5_location_debug "${HDF5_${hdf5_target_name}_LIBRARY_DEBUG}")
elseif (DEFINED "HDF5_${hdf5_lang}_LIBRARY")
set(_hdf5_location "${HDF5_${hdf5_lang}_LIBRARY}")
+ set(_hdf5_location_release "${HDF5_${hdf5_lang}_LIBRARY_RELEASE}")
+ set(_hdf5_location_debug "${HDF5_${hdf5_lang}_LIBRARY_DEBUG}")
elseif (DEFINED "HDF5_${hdf5_lang}_LIBRARY_${hdf5_target_name}")
set(_hdf5_location "${HDF5_${hdf5_lang}_LIBRARY_${hdf5_target_name}}")
else ()
@@ -1066,10 +1070,24 @@ if (HDF5_FOUND)
set(HDF5_${hdf5_lang}_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
endif ()
set_target_properties("hdf5::${hdf5_target_name}" PROPERTIES
- IMPORTED_LOCATION "${_hdf5_location}"
- IMPORTED_IMPLIB "${_hdf5_location}"
INTERFACE_INCLUDE_DIRECTORIES "${HDF5_${hdf5_lang}_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${_hdf5_definitions}")
+ if (_hdf5_location_release)
+ set_property(TARGET "hdf5::${hdf5_target_name}" APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_property(TARGET "hdf5::${hdf5_target_name}" PROPERTY
+ IMPORTED_LOCATION_RELEASE "${_hdf5_location_release}")
+ endif()
+ if (_hdf5_location_debug)
+ set_property(TARGET "hdf5::${hdf5_target_name}" APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_property(TARGET "hdf5::${hdf5_target_name}" PROPERTY
+ IMPORTED_LOCATION_DEBUG "${_hdf5_location_debug}")
+ endif()
+ if (NOT _hdf5_location_release AND NOT _hdf5_location_debug)
+ set_property(TARGET "hdf5::${hdf5_target_name}" PROPERTY
+ IMPORTED_LOCATION "${_hdf5_location}")
+ endif()
if (_hdf5_libtype STREQUAL "SHARED")
set_property(TARGET "hdf5::${hdf5_target_name}" APPEND
PROPERTY
@@ -1082,6 +1100,8 @@ if (HDF5_FOUND)
unset(_hdf5_definitions)
unset(_hdf5_libtype)
unset(_hdf5_location)
+ unset(_hdf5_location_release)
+ unset(_hdf5_location_debug)
endif ()
endif ()
@@ -1111,8 +1131,12 @@ if (HDF5_FOUND)
else()
if (DEFINED "HDF5_${hdf5_target_name}_LIBRARY")
set(_hdf5_location "${HDF5_${hdf5_target_name}_LIBRARY}")
+ set(_hdf5_location_release "${HDF5_${hdf5_target_name}_LIBRARY_RELEASE}")
+ set(_hdf5_location_debug "${HDF5_${hdf5_target_name}_LIBRARY_DEBUG}")
elseif (DEFINED "HDF5_${hdf5_lang}_HL_LIBRARY")
set(_hdf5_location "${HDF5_${hdf5_lang}_HL_LIBRARY}")
+ set(_hdf5_location_release "${HDF5_${hdf5_lang}_HL_LIBRARY_RELEASE}")
+ set(_hdf5_location_debug "${HDF5_${hdf5_lang}_HL_LIBRARY_DEBUG}")
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}")
@@ -1126,10 +1150,24 @@ if (HDF5_FOUND)
add_library("hdf5::${hdf5_target_name}" UNKNOWN IMPORTED)
string(REPLACE "-D" "" _hdf5_definitions "${HDF5_${hdf5_lang}_HL_DEFINITIONS}")
set_target_properties("hdf5::${hdf5_target_name}" PROPERTIES
- IMPORTED_LOCATION "${_hdf5_location}"
- IMPORTED_IMPLIB "${_hdf5_location}"
INTERFACE_INCLUDE_DIRECTORIES "${HDF5_${hdf5_lang}_HL_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${_hdf5_definitions}")
+ if (_hdf5_location_release)
+ set_property(TARGET "hdf5::${hdf5_target_name}" APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_property(TARGET "hdf5::${hdf5_target_name}" PROPERTY
+ IMPORTED_LOCATION_RELEASE "${_hdf5_location_release}")
+ endif()
+ if (_hdf5_location_debug)
+ set_property(TARGET "hdf5::${hdf5_target_name}" APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_property(TARGET "hdf5::${hdf5_target_name}" PROPERTY
+ IMPORTED_LOCATION_DEBUG "${_hdf5_location_debug}")
+ endif()
+ if (NOT _hdf5_location_release AND NOT _hdf5_location_debug)
+ set_property(TARGET "hdf5::${hdf5_target_name}" PROPERTY
+ IMPORTED_LOCATION "${_hdf5_location}")
+ endif()
if (_hdf5_libtype STREQUAL "SHARED")
set_property(TARGET "hdf5::${hdf5_target_name}" APPEND
PROPERTY