diff --git a/src/hdf5_tools/CMakeLists.txt b/src/hdf5_tools/CMakeLists.txt index fcb96f3..3209c12 100644 --- a/src/hdf5_tools/CMakeLists.txt +++ b/src/hdf5_tools/CMakeLists.txt @@ -13,7 +13,7 @@ elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Intel") endif () ### Find HDF5 -find_package(HDF5 COMPONENTS Fortran Fortran_HL) +find_package(HDF5 COMPONENTS C HL Fortran Fortran_HL) if (NOT ${HDF5_FOUND}) message(FATAL_ERROR "HDF5 not found, please set environment variable HDF5_ROOT to the correct path") endif () @@ -24,7 +24,11 @@ add_library(hdf5_tools hdf5_tools_f2003.f90 ) #target_link_libraries(hdf5_tools PUBLIC ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}) -target_link_libraries(hdf5_tools PUBLIC hdf5::hdf5_fortran hdf5::hdf5_hl_fortran) +target_link_libraries(hdf5_tools PUBLIC + hdf5::hdf5 + hdf5::hdf5_hl + hdf5::hdf5_fortran + hdf5::hdf5_hl_fortran) if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU") install (TARGETS hdf5_tools DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/lib)