2020-05-12 04:39:50 +08:00
|
|
|
find_package(hdf5 QUIET NO_MODULE)
|
|
|
|
if(TARGET hdf5::hdf5-shared)
|
|
|
|
set_target_properties(hdf5::hdf5-shared PROPERTIES IMPORTED_GLOBAL TRUE)
|
2021-09-14 10:34:11 +08:00
|
|
|
if(NOT TARGET hdf5::hdf5)
|
|
|
|
add_library(hdf5::hdf5 ALIAS hdf5::hdf5-shared)
|
|
|
|
endif()
|
2020-05-12 04:39:50 +08:00
|
|
|
elseif(TARGET hdf5::hdf5-static)
|
|
|
|
set_target_properties(hdf5::hdf5-static PROPERTIES IMPORTED_GLOBAL TRUE)
|
2021-09-14 10:34:11 +08:00
|
|
|
if(NOT TARGET hdf5::hdf5)
|
|
|
|
add_library(hdf5::hdf5 ALIAS hdf5::hdf5-static)
|
|
|
|
endif()
|
2020-05-12 04:39:50 +08:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "HDF5 target not found")
|
|
|
|
endif()
|
|
|
|
if(TARGET hdf5::hdf5_hl-shared)
|
|
|
|
set_target_properties(hdf5::hdf5_hl-shared PROPERTIES IMPORTED_GLOBAL TRUE)
|
2021-09-14 10:34:11 +08:00
|
|
|
if(NOT TARGET hdf5::hdf5_hl)
|
|
|
|
add_library(hdf5::hdf5_hl ALIAS hdf5::hdf5_hl-shared)
|
|
|
|
endif()
|
2020-05-12 04:39:50 +08:00
|
|
|
elseif(TARGET hdf5::hdf5_hl-static)
|
|
|
|
set_target_properties(hdf5::hdf5_hl-static PROPERTIES IMPORTED_GLOBAL TRUE)
|
2021-09-14 10:34:11 +08:00
|
|
|
if(NOT TARGET hdf5::hdf5_hl)
|
|
|
|
add_library(hdf5::hdf5_hl ALIAS hdf5::hdf5_hl-static)
|
|
|
|
endif()
|
2020-05-12 04:39:50 +08:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "HDF5 HL target not found")
|
|
|
|
endif()
|
|
|
|
set(HDF5_IS_PARALLEL ${HDF5_ENABLE_PARALLEL} CACHE BOOL "" FORCE)
|
|
|
|
set(HDF5_FOUND ON CACHE BOOL "" FORCE)
|
|
|
|
set(hdf5_FOUND ON CACHE BOOL "" FORCE)
|