[CMake] CMake Reports Incorrect HDF5 Libraries on OS X after 3.6.0 Upgrade

Breannan Smith smithbreannan at gmail.com
Sun Jul 10 18:34:15 EDT 2016


After upgrading to CMake 3.6.0 from 3.5.2, CMake fails to find HDF5 on OS X.

With 3.5.2, find_package(HDF5 REQUIRED COMPONENTS C) reports the
following for HDF5_LIBRARIES. Note the presences of libhdf5.dylib, in
this list:

/usr/local/Cellar/hdf5/1.8.16_1/lib/libhdf5.dylib;/usr/local/opt/szip/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib

With 3.6.0, the same find_package command gives the following
HDF5_LIBRARIES. Notice that libhdf5.dylib is not even present:

/usr/local/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib

The contents of the HDF5_LIBRARIES and HDF5_C_LIBRARIES are the same
under 3.6.0. Interestingly, the FindHDF5.cmake module does not report
a failure under 3.6.0 even though it fails to locate the HDF5 library.

I did not see any changes to FindHDF5.cmake listed under the 3.6
release notes [1], but diffing the module files there were extensive
edits made.

Has anyone else run into this issue or found a fix? Thank you!

[1] https://cmake.org/cmake/help/v3.6/release/3.6.html


More information about the CMake mailing list