Skip to content

Commit

Permalink
Add C HL Libraries HDF5
Browse files Browse the repository at this point in the history
  • Loading branch information
krystophny committed Dec 25, 2024
1 parent 4251cc5 commit d522b8f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hdf5_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand All @@ -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)
Expand Down

0 comments on commit d522b8f

Please sign in to comment.