Skip to content

Commit ae403b8

Browse files
committed
Updated bundled FindHDF5.cmake to support CMake 3.19+
* replaced target hdf5::hdf5 with hdf5::all to avoid conflicts with new target naming convention * The old target name hdf5::hdf5 is now defined by official FindHDF5.cmake as the target for the HDF5 C library "libhdf5"
1 parent 8bd0440 commit ae403b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmake/FindHDF5.cmake

+4-2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ function(define_hdf5_target lang libnames target_list)
9494
# We already processed this target
9595
return()
9696
endif()
97+
if(NOT ${lib} STREQUAL "hdf5" AND TARGET hdf5::hdf5)
98+
# All libraries depend on the main c-library called hdf5::hdf5
99+
target_link_libraries(hdf5::${lib} INTERFACE hdf5::hdf5)
100+
endif()
97101
else()
98102
# Start modeling the dependency structure of the imported libraries
99103
if(HDF5_C_LIBRARY_${lib})
@@ -447,8 +451,6 @@ endif()
447451

448452

449453
if(HDF5_FOUND)
450-
include(cmake/PrintTargetProperties.cmake)
451-
print_target_properties(hdf5::all)
452454
if(NOT TARGET hdf5::all)
453455
add_library(hdf5::all IMPORTED INTERFACE)
454456
endif()

0 commit comments

Comments
 (0)