From 1b2604ff8f7c58d1c1b46d55336064d5d7eff537 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 2 Apr 2024 12:18:54 -0500 Subject: [PATCH] updated resetting status if cmake option fails --- CMakeLists.txt | 7 +++++++ config/cmake/ConfigureChecks.cmake | 3 +++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 879e7307bf0..1fbaad21cbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -679,6 +679,7 @@ if (HDF5_ENABLE_HDFS) list (APPEND LINK_LIBS -pthread) endif () else () + set (HDF5_ENABLE_HDFS OFF CACHE BOOL "Enable HDFS" FORCE) message (FATAL_ERROR "Set to use libhdfs library, but could not find or use libhdfs. Please verify that the path to HADOOP_HOME is valid, and/or reconfigure without HDF5_ENABLE_HDFS") endif () endif () @@ -806,8 +807,12 @@ if (HDF5_ENABLE_SUBFILING_VFD) unset (CMAKE_EXTRA_INCLUDE_FILES) unset (CMAKE_REQUIRED_LIBRARIES) + if(NOT H5_HAVE_SUBFILING_VFD EQUAL 1) + set (HDF5_ENABLE_SUBFILING_VFD OFF CACHE BOOL "Build Parallel HDF5 Subfiling VFD" FORCE) + endif() endif() + #option (DEFAULT_API_VERSION "Enable v1.16 API (v16, v18, v110, v112, v114, v116)" "v116") set (DEFAULT_API_VERSION "v116" CACHE STRING "Enable v1.16 API (v16, v18, v110, v112, v114, v116)") set_property (CACHE DEFAULT_API_VERSION PROPERTY STRINGS v16 v18 v110 v112 v114 v116) @@ -940,6 +945,8 @@ endif () option (HDF5_ENABLE_MAP_API "Build the map API" OFF) if (HDF5_ENABLE_MAP_API) set (H5_HAVE_MAP_API 1) +else () + set (HDF5_ENABLE_MAP_API OFF CACHE BOOL "Build the map API" FORCE) endif () #----------------------------------------------------------------------------- diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index e48fa557624..81633da8909 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -613,6 +613,7 @@ if (HDF5_ENABLE_DIRECT_VFD) if (HAVE_O_DIRECT AND HAVE_POSIX_MEMALIGN) set (${HDF_PREFIX}_HAVE_DIRECT 1) else () + set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) message (FATAL_ERROR "The direct VFD was requested but cannot be built.\nIt requires O_DIRECT flag support and posix_memalign()") endif () endif () @@ -629,6 +630,7 @@ option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF) list (APPEND LINK_LIBS ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) INCLUDE_DIRECTORIES (${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) else () + set (HDF5_ENABLE_ROS3_VFD OFF CACHE BOOL "Build the ROS3 Virtual File Driver" FORCE) message (WARNING "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.") endif () endif () @@ -645,6 +647,7 @@ if (HDF5_ENABLE_MIRROR_VFD) ${HDF_PREFIX}_HAVE_FORK) set (${HDF_PREFIX}_HAVE_MIRROR_VFD 1) else() + set (HDF5_ENABLE_MIRROR_VFD OFF CACHE BOOL "Build the Mirror Virtual File Driver" FORCE) message(WARNING "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.") endif() endif()