Skip to content

Commit

Permalink
COMP: Fix build with ITK_USE_SYSTEM_HDF5=ON
Browse files Browse the repository at this point in the history
CMake Error at CMake/ITKModuleMacros.cmake:312 (target_link_libraries):
  Target "ITKIOHDF5" links to:

    hdf5::hdf5_hl

  but the target was not found.

Closes #3593.
  • Loading branch information
dzenanz committed Sep 2, 2022
1 parent fb0a377 commit d93d987
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Modules/ThirdParty/HDF5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ if(ITK_USE_SYSTEM_HDF5)
# When ITK's config is loaded, load HDF5 too.
set(ITKHDF5_EXPORT_CODE_INSTALL "
${_HDF5_DIR_CODE}
find_package(HDF5 ${_HDF5_NO_MODULE_ARG} REQUIRED COMPONENTS CXX C)
find_package(HDF5 ${_HDF5_NO_MODULE_ARG} REQUIRED COMPONENTS CXX C HL)
")
set(ITKHDF5_EXPORT_CODE_BUILD "
if(NOT ITK_BINARY_DIR)
${_HDF5_DIR_CODE}
find_package(HDF5 ${_HDF5_NO_MODULE_ARG} REQUIRED COMPONENTS CXX C)
find_package(HDF5 ${_HDF5_NO_MODULE_ARG} REQUIRED COMPONENTS CXX C HL)
endif()
")

Expand Down
6 changes: 3 additions & 3 deletions Modules/ThirdParty/HDF5/itk-module-init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ mark_as_advanced(ITK_USE_SYSTEM_HDF5)
if(ITK_USE_SYSTEM_HDF5)
set(HDF5_NO_MODULE 1)
if(ITK_BUILD_SHARED_LIBS)
find_package(HDF5 QUIET NO_MODULE COMPONENTS CXX C shared)
find_package(HDF5 QUIET NO_MODULE COMPONENTS CXX C HL shared)
else()
find_package(HDF5 QUIET NO_MODULE COMPONENTS CXX C static)
find_package(HDF5 QUIET NO_MODULE COMPONENTS CXX C HL static)
endif()

if(NOT HDF5_FOUND)
find_package(HDF5 REQUIRED COMPONENTS CXX C)
find_package(HDF5 REQUIRED COMPONENTS CXX C HL)
set(HDF5_NO_MODULE 0)
endif()
endif()

0 comments on commit d93d987

Please sign in to comment.