Threads::Threads linked unconditionally to hdf5::hdf5-static and hdf5::hdf5_fortran-static

Dear experts…

In cmake/hdf5-targets.cmake of the 2.0.0 library, Threads::Threads seems to be linked to hdf5::hdf5-static and hdf5::hdf5_fortran-static regardless of the setting on wheather to use threading or not, but is it really needed?

Kazuyoshi

Hi @furutaka.kazuyoshi,

HDF5 currently still always calls find_package(Threads) and adds it to the linked libraries if found, which is probably why it appears here in the targets file. There has been some internal discussion around reworking our CMake logic to only link in a threading package when actually used, but no progress has been made on that so far. If your HDF5 installation wasn’t built with thread safety enabled, there shouldn’t be any need for Threads::Threads to be linked in; this is simply a quirk of our current CMake logic.