Problem with HDF5 Fortran and cmake.


#1

I tried to use HDF5 with Fortran via cmake, but It looks like there is a problem with include directory

find_package( HDF5 REQUIRED COMPONENTS Fortran )
target_link_libraries( main ${HDF5_LIBRARIES} )
target_include_directories( main PRIVATE ${HDF5_INCLUDE_DIRS} )

while ${HDF5_LIBRARIES} retruns the imported library hdf5_fortran-shared, ${HDF5_INCLUDE_DIRS} returns the include directory for C/C++ not Fortran.

Please fix it.


#2

Looks like the associated subdir was dropped - there are two include paths in the properties but both are the same path.
Will investigate.
A workaround might be to edit the targets file and fix the path in the fortran targets.

Allen


#3

The issue has been captured in HDFFV-11012 in our JIRA system.