diff --git a/CMakeLists.txt b/CMakeLists.txt index c003f39ac1..ac05e56b23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,13 @@ if(HDF5_IS_PARALLEL) message(STATUS "Using parallel HDF5") endif() +# Version 1.12 of HDF5 deprecates the H5Oget_info_by_idx() interface. +# Thus, we give these flags to allow usage of the old interface in newer +# versions of HDF5. +if(NOT (${HDF5_VERSION} VERSION_LESS 1.12.0)) + list(APPEND cxxflags -DH5Oget_info_by_idx_vers=1 -DH5O_info_t_vers=1) +endif() + #=============================================================================== # Set compile/link flags based on which compiler is being used #===============================================================================