From 6bf39b3d6abd050b4cf6009841537b7e23d7d182 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 19 Aug 2025 12:12:03 +0500 Subject: [PATCH] cmake - also use find_package to find hdf5 --- cmake/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 916ad3d22b..2c6aed06a3 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -675,7 +675,16 @@ if(HDF5_SUPPORT) z dl ) else() - message(FATAL_ERROR "HDF5_LIBRARIES is not provided.") + find_package(HDF5 CONFIG) + if(NOT HDF5_DIR) + message( + FATAL_ERROR + "HDF5_LIBRARY_DIR is not provided (current value: '${HDF5_LIBRARY_DIR}'). " + "Also could not find HDF5 package." + ) + endif() + message(STATUS "Found HDF5 package: '${HDF5_DIR}'.") + set(HDF5_LIBRARIES hdf5_cpp-static) endif() endif()