FindHDF5 does not find zlib and libdl
My issue seems similar to #16566 (closed), that HDF5_C_LIBRARIES
does not include zlib
and dl
.
I have a static libhdf5 1.10.4 build with cmake. I enable zlib
and require dl
. HDF5 and zlib are installed in a non-standard location /data/Debug
. I checked that HDF5 correctly installs hdf5-config.cmake
in /data/Debug/lib/cmake/hdf5
. I have removed the system-hdf5 to avoid confusion.
To build my dependent library, I configure cmake 3.13.4 with CMAKE_PREFIX_PATH
, CMAKE_INSTALL_PREFIX
and HDF5_ROOT
pointing to /data/Debug
where HDF5 is installed. Furthermore I set HDF5_USE_STATIC_LIBS=ON
.
find_package(HDF5 QUIET REQUIRED)
prints:
-- Found HDF5 at /data/Debug/lib/cmake/hdf5 via NO_MODULE. Now trying to extract locations etc.
-- Unable to determine HDF5 C flags from HDF5 wrapper.
-- Unable to determine HDF5 C version from HDF5 wrapper.
-- HDF5_DIR: /data/Debug/lib/cmake/hdf5
-- HDF5_DEFINITIONS:
-- HDF5_INCLUDE_DIRS: /data/Debug/include
-- HDF5_LIBRARIES: /data/Debug/lib/libhdf5.a
-- HDF5_HL_LIBRARIES:
-- HDF5_C_DEFINITIONS:
-- HDF5_C_INCLUDE_DIR: /data/Debug/include
-- HDF5_C_INCLUDE_DIRS: /data/Debug/include
-- HDF5_C_LIBRARY:
-- HDF5_C_LIBRARIES: /data/Debug/lib/libhdf5.a
-- HDF5_C_HL_LIBRARY:
-- HDF5_C_HL_LIBRARIES: