Commit bf67fff0 authored by Kris Thielemans's avatar Kris Thielemans Committed by Brad King

FindHDF5: recognize hdf5:: prefix when using hdf5-config.cmake

Some versions of HDF5 use this prefix on their imported targets.
parent e629be4a
......@@ -404,12 +404,16 @@ if(NOT HDF5_FOUND)
set(HDF5_IS_PARALLEL ${HDF5_ENABLE_PARALLEL})
set(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR})
set(HDF5_LIBRARIES)
set(HDF5_C_TARGET hdf5)
set(HDF5_C_HL_TARGET hdf5_hl)
set(HDF5_CXX_TARGET hdf5_cpp)
set(HDF5_CXX_HL_TARGET hdf5_hl_cpp)
set(HDF5_Fortran_TARGET hdf5_fortran)
set(HDF5_Fortran_HL_TARGET hdf5_hl_fortran)
if (NOT TARGET hdf5 AND NOT TARGET hdf5-static AND NOT TARGET hdf5-shared)
# Some HDF5 versions (e.g. 1.8.18) used hdf5::hdf5 etc
set(_target_prefix "hdf5::")
endif()
set(HDF5_C_TARGET ${_target_prefix}hdf5)
set(HDF5_C_HL_TARGET ${_target_prefix}hdf5_hl)
set(HDF5_CXX_TARGET ${_target_prefix}hdf5_cpp)
set(HDF5_CXX_HL_TARGET ${_target_prefix}hdf5_hl_cpp)
set(HDF5_Fortran_TARGET ${_target_prefix}hdf5_fortran)
set(HDF5_Fortran_HL_TARGET ${_target_prefix}hdf5_hl_fortran)
if(HDF5_USE_STATIC_LIBRARIES)
set(_suffix "-static")
else()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment