Skip to content

Commit

Permalink
BUG: Fix HDF5 installation with cmake targets
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed May 13, 2021
1 parent ac080c9 commit 4ecd711
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Modules/ThirdParty/HDF5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ endif()
if(ITK_USE_SYSTEM_HDF5)

if(HDF5_DIR)
# When ITK's config is loaded, load HDF5 too.
set(ITKHDF5_EXPORT_CODE_INSTALL "
set(HDF5_DIR \"${HDF5_DIR}\")
find_package(HDF5 REQUIRED NO_MODULE)
set(_HDF5_DIR_CODE "set(HDF5_DIR \"${HDF5_DIR}\")")
endif()
# When ITK's config is loaded, load HDF5 too.
set(ITKHDF5_EXPORT_CODE_INSTALL "
${_HDF5_DIR_CODE}
find_package(HDF5 REQUIRED COMPONENTS CXX C)
")
set(ITKHDF5_EXPORT_CODE_BUILD "
if(NOT ITK_BINARY_DIR)
set(HDF5_DIR \"${HDF5_DIR}\")
find_package(HDF5 REQUIRED NO_MODULE)
${_HDF5_DIR_CODE}
find_package(HDF5 REQUIRED COMPONENTS CXX C)
endif()
")
endif()

if(BUILD_SHARED_LIBS)
if (TARGET hdf5-shared)
Expand Down

0 comments on commit 4ecd711

Please sign in to comment.