From ce7075e71e3c36c099eb639523285076d0c3289e Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 18 Aug 2023 10:09:36 -0400 Subject: [PATCH] CMake: Warn and Continue on Empty HDF5_VERSION Seen on Conda-Forge for arm64 on macOS for HDF5 1.14.1 --- CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1c0af5d91..c47f230507 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -331,10 +331,16 @@ endif() # HDF5 checks string(CONCAT openPMD_HDF5_STATUS "") # version: lower limit -if(openPMD_HAVE_HDF5 AND HDF5_VERSION VERSION_LESS 1.8.13) - string(CONCAT openPMD_HDF5_STATUS - "Found HDF5 version ${HDF5_VERSION} is too old. At least " - "version 1.8.13 is required.\n") +if(openPMD_HAVE_HDF5) + if(HDF5_VERSION STREQUAL "") + message(WARNING "HDF5_VERSION is empty. Now assuming it is 1.8.13 or newer.") + else() + if(HDF5_VERSION VERSION_LESS 1.8.13) + string(CONCAT openPMD_HDF5_STATUS + "Found HDF5 version ${HDF5_VERSION} is too old. At least " + "version 1.8.13 is required.\n") + endif() + endif() endif() # we imply support for parallel I/O if MPI variant is ON if(openPMD_HAVE_MPI AND openPMD_HAVE_HDF5