Skip to content

Commit

Permalink
[CMake] add HDF5 as target_include_dirs for libraries
Browse files Browse the repository at this point in the history
As we currently do not depend on IO due to circular dependencies,
we need to add it explicitly.
  • Loading branch information
KrisThielemans committed Feb 4, 2025
1 parent a692a0a commit e88bbf5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/buildblock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ if (LLN_FOUND)
target_link_libraries(buildblock PUBLIC ${LLN_LIBRARIES})
endif()

if (RDF_FOUND)
# TODO cannot do this as it creates circular dependencies
# target_link_libraries(buildblock PUBLIC local_IO_GE)
if (HAVE_HDF5)
# for GEHDF5, TODO remove once IO dependency added or GEHDF5Wrapper no longer includes H5Cpp.h
target_include_directories(buildblock PRIVATE ${HDF5_INCLUDE_DIRS})
endif()

# TODO currently needed as filters need fourier
Expand Down
5 changes: 5 additions & 0 deletions src/data_buildblock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ endif()
include(stir_lib_target)

target_link_libraries(${dir} PUBLIC buildblock)

if (HAVE_HDF5)
# for GEHDF5, TODO remove once IO dependency added or GEHDF5Wrapper no longer includes H5Cpp.h
target_include_directories(data_buildblock PRIVATE ${HDF5_INCLUDE_DIRS})
endif()
5 changes: 5 additions & 0 deletions src/listmode_buildblock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ endif()
include(stir_lib_target)

target_link_libraries(listmode_buildblock PUBLIC data_buildblock )

if (HAVE_HDF5)
# for GEHDF5, TODO remove once IO dependency added or GEHDF5Wrapper no longer includes H5Cpp.h
target_include_directories(listmode_buildblock PRIVATE ${HDF5_INCLUDE_DIRS})
endif()
5 changes: 5 additions & 0 deletions src/recon_buildblock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ if (STIR_WITH_Parallelproj_PROJECTOR)
endif()
endif()

if (HAVE_HDF5)
# for GEHDF5, TODO remove once IO dependency added or GEHDF5Wrapper no longer includes H5Cpp.h
target_include_directories(recon_buildblock PRIVATE ${HDF5_INCLUDE_DIRS})
endif()

if (STIR_WITH_CUDA)
target_link_libraries(recon_buildblock PRIVATE CUDA::cudart)
endif()

0 comments on commit e88bbf5

Please sign in to comment.