Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow finding user-installed HDF5 #15199

Merged
merged 1 commit into from
May 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 21 additions & 1 deletion cmake/modules/FindDEAL_II_HDF5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,27 @@ set(HDF5_PREFER_PARALLEL TRUE)
find_package(HDF5)

set(_include_dirs "${HDF5_INCLUDE_DIRS}")
set(_libraries "${HDF5_LIBRARIES};${HDF5_HL_LIBRARIES}")
set(_libraries_tmp "${HDF5_LIBRARIES};${HDF5_HL_LIBRARIES}")

# HDF5_LIBRARIES and HDF5_HL_LIBRARIES might contain targets or full paths to libraries
# try to find full paths in the former case
set(_libraries)
foreach(_library ${_libraries_tmp})
if(TARGET ${_library})
get_target_property(_configurations ${_library} IMPORTED_CONFIGURATIONS)
if(_configurations)
foreach(_configuration ${_configurations})
get_target_property(_imported_location ${_library} IMPORTED_LOCATION_${_configuration})
list(APPEND _libraries ${_imported_location})
endforeach()
else()
get_target_property(_imported_location ${_library} IMPORTED_LOCATION)
list(APPEND _libraries ${_imported_location})
endif()
else()
list(APPEND _libraries ${_library})
endif()
endforeach()

process_feature(HDF5
LIBRARIES
Expand Down