Skip to content
Snippets Groups Projects
Commit ad643fd1 authored by Walter's avatar Walter
Browse files

Adds HDF5 api calls depending on HDF5 library version

parent 88844874
Branches
Tags v1.0
No related merge requests found
......@@ -51,6 +51,17 @@ find_package(HDF5 COMPONENTS CXX HL)
if(HDF5_FOUND)
message(STATUS "HDF5 Found, Version:")
message(STATUS ${HDF5_VERSION})
set(USE_OLD_HDF5_API false)
if(${HDF5_VERSION} VERSION_LESS_EQUAL "1.14.1")
set(USE_OLD_HDF5_API true)
endif()
if(USE_OLD_HDF5_API)
message(STATUS "Using old HDF5 API Calls")
add_compile_definitions(OLD_HDF5_API)
endif()
endif()
include_directories(${HDF5_INCLUDE_DIRS})
......
......@@ -43,8 +43,14 @@ herr_t collectDatasetNames(hid_t loc_id, const char *name, const H5L_info_t* /*l
{
// Open the object using its name.
hid_t object = H5Oopen(loc_id, name, H5P_DEFAULT);
H5O_info_t object_info;
H5Oget_info(object, &object_info, H5O_INFO_ALL);
#ifdef OLD_HDF5_API
H5O_info_t object_info;
H5Oget_info(object, &object_info);
#else
H5O_info1_t object_info;
H5Oget_info1(object, &object_info);
#endif
//Write object name to vector if it is a dataset:
if (object_info.type == H5O_TYPE_DATASET){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment