Skip to content

Commit

Permalink
Fix CMake: HDF5 Libs are PUBLIC (#1520)
Browse files Browse the repository at this point in the history
We do not yet use `FindHDF5.cmake` CMake targets and thus need to ensure
the libs are propagated properly (they are not consumed necessarily as private)

First seen when building with `-Wl,--disable-new-dtags` for RPATH
over newer RUNPATH.
  • Loading branch information
ax3l authored Aug 20, 2023
1 parent 2384af0 commit e01f721
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,9 @@ target_include_directories(openPMD SYSTEM PRIVATE
$<TARGET_PROPERTY:openPMD::thirdparty::toml11,INTERFACE_INCLUDE_DIRECTORIES>)

# HDF5 Backend
# TODO: Once we require CMake 3.20+, simply link hdf5::hdf5 C lib target
if(openPMD_HAVE_HDF5)
target_link_libraries(openPMD PRIVATE ${HDF5_LIBRARIES})
target_link_libraries(openPMD PUBLIC ${HDF5_LIBRARIES})
target_include_directories(openPMD SYSTEM PRIVATE ${HDF5_INCLUDE_DIRS})
target_compile_definitions(openPMD PRIVATE ${HDF5_DEFINITIONS})
endif()
Expand Down

0 comments on commit e01f721

Please sign in to comment.