From d522b8ffec401d30981a27d64b0f72b340b4c216 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Wed, 25 Dec 2024 09:40:01 +0000 Subject: [PATCH] Add C HL Libraries HDF5 --- src/hdf5_tools/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)