From 7b3bdd4b0c6f6dfa62a98c09a0488d5420903066 Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Sat, 6 May 2023 01:09:43 +0200
Subject: [PATCH] Fix cmake configuration for missing HDF5 libraries

---
 CMakeLists.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6727df3c9..d53f439e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -237,6 +237,9 @@ if (PUGS_ENABLE_HDF5 MATCHES "^(AUTO|ON)$")
   if (${HDF5_FOUND})
     set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} ${HDF5_C_DEFINITIONS}")
     include_directories(SYSTEM "${HDF5_C_INCLUDE_DIRS}")
+  else()
+    unset(HDF5_C_LIBRARIES)
+    unset(HDF5_C_HL_LIBRARIES)
   endif()
 
   set(PUGS_HAS_HDF5 ${HDF5_FOUND})
@@ -696,10 +699,10 @@ endif()
 if (HDF5_FOUND)
   message(" HDF5: ${HDF5_VERSION} parallel: ${HDF5_IS_PARALLEL}")
 else()
-  if (PUGS_ENABLE_SLEPC MATCHES "^(AUTO|ON)$")
-    message(" SLEPc: not found!")
+  if (PUGS_ENABLE_HDF5 MATCHES "^(AUTO|ON)$")
+    message(" HDF5: not found!")
   else()
-      message(" SLEPc: explicitly deactivated!")
+      message(" HDF5: explicitly deactivated!")
   endif()
 endif()
 
-- 
GitLab