Skip to content

FindHDF5: Fix search with HDF5_ROOT

Brad King requested to merge brad.king/cmake:FindHDF5-fix-HDF5_ROOT into master

Refactoring in commit fdfb0c06 turned off a large amount of its logic when HDF5_ROOT is set. This caused use of the hdf5 compiler wrapper to extract all needed libraries (e.g. z, dl as dependencies of hdf5 static libraries) to be skipped when using HDF5_ROOT.

Fix the search logic to honor HDF5_ROOT in all code paths. Restrict the search for hdf5-specific components to this root, but allow external libraries to be found anywhere.

Fixes: #16566 (closed)

Merge request reports