From bf7cd4ce02386591d9cf87b101425d279f8fd397 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Tue, 29 Aug 2023 10:48:34 -0500 Subject: [PATCH 1/6] Update VOL CMake for REST VOL --- CMakeVOL.cmake | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/CMakeVOL.cmake b/CMakeVOL.cmake index a5f499ee456..afb2996dcbb 100644 --- a/CMakeVOL.cmake +++ b/CMakeVOL.cmake @@ -34,11 +34,31 @@ if (HDF5_VOL_ALLOW_EXTERNAL) message (FATAL_ERROR "HDF5_ALLOW_EXTERNAL_SUPPORT must be set to 'GIT' to allow building of external HDF5 VOL connectors") endif () + set (HDF5_LIB_TARGETS "") + set (HDF5_HL_LIB_TARGETS "") + + if (BUILD_STATIC_LIBS) + list(APPEND HDF5_LIB_TARGETS ${HDF5_LIB_TARGET}) + list(APPEND HDF5_HL_LIB_TARGETS ${HDF5_HL_LIB_TARGET}) + endif() + + if (BUILD_SHARED_LIBS) + list(APPEND HDF5_LIB_TARGETS ${HDF5_LIBSH_TARGET}) + list(APPEND HDF5_HL_LIB_TARGETS ${HDF5_HL_LIBSH_TARGET}) + endif() + # For compatibility, set some variables that projects would # typically look for after calling find_package(HDF5) set (HDF5_FOUND 1) - set (HDF5_LIBRARIES "${HDF5_LIBSH_TARGET};${LINK_LIBS};${LINK_COMP_LIBS};$<$:MPI::MPI_C>") + set (HDF5_LIBRARIES "${HDF5_LIB_TARGETS};${LINK_LIBS};${LINK_COMP_LIBS};$<$:MPI::MPI_C>") set (HDF5_INCLUDE_DIRS "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + set (HDF5_DIR "${HDF5_SOURCE_DIR}") + + set (HDF5_C_LIBRARIES "${HDF5_LIB_TARGETS}") + + if (HDF5_BUILD_HL_LIB) + set (HDF5_C_HL_LIBRARIES "${HDF5_HL_LIB_TARGETS}") + endif() set (HDF5_MAX_EXTERNAL_VOLS 10) set (HDF5_EXTERNAL_VOL_TARGETS "") @@ -134,6 +154,8 @@ if (HDF5_VOL_ALLOW_EXTERNAL) define_property ( TARGET PROPERTY HDF5_VOL_TARGETS + BRIEF_DOCS "Generated targets of this connector" + FULL_DOCS "Generated targets of this connector" ) set_target_properties ( @@ -149,6 +171,7 @@ if (HDF5_VOL_ALLOW_EXTERNAL) TARGET PROPERTY HDF5_VOL_NAME BRIEF_DOCS "VOL connector name to use for the HDF5_VOL_CONNECTOR environment variable when testing" + FULL_DOCS "VOL connector name to use for the HDF5_VOL_CONNECTOR environment variable when testing" ) set_target_properties ( @@ -164,6 +187,7 @@ if (HDF5_VOL_ALLOW_EXTERNAL) TARGET PROPERTY HDF5_VOL_TEST_PARALLEL BRIEF_DOCS "Whether the VOL connector should be tested with the parallel API tests" + FULL_DOCS "Whether the VOL connector should be tested with the parallel API tests" ) set_target_properties ( From 5c5c3f150534c09b3504335853adac7d97e4ed3c Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Wed, 30 Aug 2023 12:16:58 -0500 Subject: [PATCH 2/6] Prevent linking static libs to VOLs --- CMakeVOL.cmake | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/CMakeVOL.cmake b/CMakeVOL.cmake index afb2996dcbb..ab88ac2d7b8 100644 --- a/CMakeVOL.cmake +++ b/CMakeVOL.cmake @@ -34,30 +34,17 @@ if (HDF5_VOL_ALLOW_EXTERNAL) message (FATAL_ERROR "HDF5_ALLOW_EXTERNAL_SUPPORT must be set to 'GIT' to allow building of external HDF5 VOL connectors") endif () - set (HDF5_LIB_TARGETS "") - set (HDF5_HL_LIB_TARGETS "") - - if (BUILD_STATIC_LIBS) - list(APPEND HDF5_LIB_TARGETS ${HDF5_LIB_TARGET}) - list(APPEND HDF5_HL_LIB_TARGETS ${HDF5_HL_LIB_TARGET}) - endif() - - if (BUILD_SHARED_LIBS) - list(APPEND HDF5_LIB_TARGETS ${HDF5_LIBSH_TARGET}) - list(APPEND HDF5_HL_LIB_TARGETS ${HDF5_HL_LIBSH_TARGET}) - endif() - # For compatibility, set some variables that projects would # typically look for after calling find_package(HDF5) set (HDF5_FOUND 1) - set (HDF5_LIBRARIES "${HDF5_LIB_TARGETS};${LINK_LIBS};${LINK_COMP_LIBS};$<$:MPI::MPI_C>") + set (HDF5_LIBRARIES "${HDF5_LIBSH_TARGET};${LINK_LIBS};${LINK_COMP_LIBS};$<$:MPI::MPI_C>") set (HDF5_INCLUDE_DIRS "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") set (HDF5_DIR "${HDF5_SOURCE_DIR}") - set (HDF5_C_LIBRARIES "${HDF5_LIB_TARGETS}") - + set (HDF5_C_LIBRARIES "${HDF5_LIBRARIES}") + if (HDF5_BUILD_HL_LIB) - set (HDF5_C_HL_LIBRARIES "${HDF5_HL_LIB_TARGETS}") + set (HDF5_C_HL_LIBRARIES "${HDF5_HL_LIBSH_TARGET}") endif() set (HDF5_MAX_EXTERNAL_VOLS 10) From 78960afc352d9e95bb8fe69641721e5e4cb5cbfe Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Wed, 30 Aug 2023 15:48:34 -0500 Subject: [PATCH 3/6] index on fetch_local: 5c5c3f1505 Prevent linking static libs to VOLs From bf3e96d2bbc620de94a05c74a8e5459806dbad82 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Wed, 30 Aug 2023 16:13:48 -0500 Subject: [PATCH 4/6] index on (no branch): 9a36d3e7b1 On fetch_local: WIP:add source dir fetch option for vols From c86f9af06d37da6e34110f4717a0c4d431bbe34e Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Thu, 31 Aug 2023 09:57:50 -0500 Subject: [PATCH 5/6] Allow building of VOL from local source --- CMakeVOL.cmake | 76 ++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/CMakeVOL.cmake b/CMakeVOL.cmake index f9fafb8fe0b..1e6826bb7b9 100644 --- a/CMakeVOL.cmake +++ b/CMakeVOL.cmake @@ -30,20 +30,16 @@ endfunction () option (HDF5_VOL_ALLOW_EXTERNAL "Allow building of external HDF5 VOL connectors with FetchContent" OFF) mark_as_advanced (HDF5_VOL_ALLOW_EXTERNAL) if (HDF5_VOL_ALLOW_EXTERNAL) - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "NO" OR NOT HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") - message (FATAL_ERROR "HDF5_ALLOW_EXTERNAL_SUPPORT must be set to 'GIT' or 'LOCAL_SOURCE_DIR' to allow building of external HDF5 VOL connectors") - endif () - - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_SOURCE_DIR" AND NOT HDF5_VOL_PATH_TEMP) - message(FATAL_ERROR "HDF5_VOL_PATH_TEMP must have a path to VOL source when HDF5_ALLOW_EXTERNAL_SUPPORT = LOCAL_SOURCE_DIR") - endif () + + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "NO" OR (NOT HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" AND NOT HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR")) + message (FATAL_ERROR "HDF5_ALLOW_EXTERNAL_SUPPORT must be set to 'GIT' or 'LOCAL_DIR' to allow building of external HDF5 VOL connectors") + endif() # For compatibility, set some variables that projects would # typically look for after calling find_package(HDF5) set (HDF5_FOUND 1) set (HDF5_LIBRARIES "${HDF5_LIBSH_TARGET};${LINK_LIBS};${LINK_COMP_LIBS};$<$:MPI::MPI_C>") set (HDF5_INCLUDE_DIRS "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - set (HDF5_DIR "${HDF5_SOURCE_DIR}") set (HDF5_C_LIBRARIES "${HDF5_LIBRARIES}") @@ -63,19 +59,19 @@ if (HDF5_VOL_ALLOW_EXTERNAL) while (vol_idx_len LESS vol_idx_num_digits) string (PREPEND vol_idx_fixed "0") math (EXPR vol_idx_len "${vol_idx_len}+1") - endwhile () + endwhile() + + set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build") + mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed}) + + set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build") + mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed}) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") - # TODO should create cmake/user facing var called "HDF5_VOL_URL" or "HDF5_VOL_DIR" while HDF5_VOL_SOURCE stays an internal cmake var name - set (HDF5_VOL_SOURCE "HDF5_VOL_URL${vol_idx_fixed}") - set (${HDF5_VOL_SOURCE} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build") - mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed}) - elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_SOURCE_DIR") - set (HDF5_VOL_SOURCE "HDF5_VOL_DIR${vol_idx_fixed}") - set (${HDF5_VOL_SOURCE} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build") - mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed}) + set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}") + elseif(HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}") else() - set(A "TODO") endif() if (NOT "${HDF5_VOL_SOURCE}" STREQUAL "") @@ -83,9 +79,10 @@ if (HDF5_VOL_ALLOW_EXTERNAL) string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE) if (hdf5_vol_name_pos EQUAL -1) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") - message (SEND_ERROR "Invalid URL '${HDF5_VOL_URL${vol_idx_fixed}}' specified for HDF5_VOL_URL${vol_idx_fixed}") - else () - message (SEND_ERROR "Invalid source path '${HDF5_VOL_DIR${vol_idx_fixed}}' specified for HDF5_VOL_DIR${vol_idx_fixed}") + message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}") + else() + message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}") + endif() endif () math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1") @@ -100,17 +97,11 @@ if (HDF5_VOL_ALLOW_EXTERNAL) # Set some cache variables that can be set by users when building set ("HDF5_VOL_${hdf5_vol_name_upper}_NAME" "" CACHE STRING "Name of VOL connector to set for the HDF5_VOL_CONNECTOR environment variable") - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") - set ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH" "main" CACHE STRING "Git branch (or tag) to use when building VOL connector '${hdf5_vol_name}'") - mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH") - else () - set ("HDF5_VOL_${hdf5_vol_name_upper}_SOURCE_DIR" "${HDF5_VOL_SOURCE_DIR}" CACHE STRING "Local source directory to use when building VOL connector '${hdf5_vol_name}'") - mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_SOURCE_DIR") - endif() - + set ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH" "main" CACHE STRING "Git branch (or tag) to use when building VOL connector '${hdf5_vol_name}'") option ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL" "Whether to test VOL connector '${hdf5_vol_name}' against the parallel API tests" OFF) mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_NAME") + mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH") mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL") if (HDF5_TEST_API) @@ -119,25 +110,27 @@ if (HDF5_VOL_ALLOW_EXTERNAL) endif () endif () - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" AND"${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" STREQUAL "") + if (("${HDF5_ALLOW_EXTERNAL_SUPPORT}" MATCHES "GIT") AND ("${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" STREQUAL "")) message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_BRANCH must be set to a valid git branch name (or git tag) to build VOL connector '${hdf5_vol_name}'") endif () - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SOURCE_DIR" AND ${HDF5_VOL_{hdf5_vol_name_upper}_SOURCE_DIR} STREQUAL "") - message (SEND_ERROR "${HDF5_VOL_{hdf5_vol_name_upper}_SOURCE_DIR} must be set to a valid local path to build VOL connector '${hdf5_vol_name}'") - endif() + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + if (NOT (EXISTS ${HDF5_VOL_SOURCE} AND IS_DIRECTORY ${HDF5_VOL_SOURCE})) + message (FATAL_ERROR "HDF5_VOL_PATH${vol_idx_fixed} must be an absolute path to a valid directory") + else() + endif() + endif () if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") FetchContent_Declare (HDF5_VOL_${hdf5_vol_name_lower} - GIT_REPOSITORY "${HDF5_VOL_URL${vol_idx_fixed}}" + GIT_REPOSITORY "${HDF5_VOL_SOURCE}" GIT_TAG "${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" ) - elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SOURCE_DIR") + elseif(HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") FetchContent_Declare (HDF5_VOL_${hdf5_vol_name_lower} - SOURCE_DIR "${HDF5_VOL_SOURCE_LOCAL}" + SOURCE_DIR "${HDF5_VOL_SOURCE}" ) - else () - set (A "TODO") + else() endif() FetchContent_GetProperties(HDF5_VOL_${hdf5_vol_name_lower}) @@ -145,7 +138,12 @@ if (HDF5_VOL_ALLOW_EXTERNAL) FetchContent_Populate(HDF5_VOL_${hdf5_vol_name_lower}) if (NOT EXISTS "${hdf5_vol_${hdf5_vol_name_lower}_SOURCE_DIR}/CMakeLists.txt") - message (SEND_ERROR "The git repository branch '${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file") + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + message (SEND_ERROR "The git repository branch '${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file") + elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + message(SEND_ERROR "The local directory '${HDF5_VOL_SOURCE}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file") + else() + endif() endif () # If there are any calls to find_package(HDF5) in the connector's From 0af4447cf1dee507a359ae9a276c08aa7e5a6cc3 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Fri, 1 Sep 2023 12:16:56 -0500 Subject: [PATCH 6/6] Move LOCAL_DIR option to HDF5_VOL_ALLOW_EXTERNAL --- CMakeVOL.cmake | 31 +++++++++++++++---------------- doc/cmake-vols-fetchcontent.md | 17 ++++++----------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/CMakeVOL.cmake b/CMakeVOL.cmake index 9822ece214c..79afa59a2fb 100644 --- a/CMakeVOL.cmake +++ b/CMakeVOL.cmake @@ -27,11 +27,11 @@ function (get_generated_cmake_targets out_var dir) endfunction () # For now, only support building of external VOL connectors with FetchContent -option (HDF5_VOL_ALLOW_EXTERNAL "Allow building of external HDF5 VOL connectors with FetchContent" OFF) +option (HDF5_VOL_ALLOW_EXTERNAL "Allow building of external HDF5 VOL connectors with FetchContent" "NO") mark_as_advanced (HDF5_VOL_ALLOW_EXTERNAL) if (HDF5_VOL_ALLOW_EXTERNAL) - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "NO" OR (NOT HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" AND NOT HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR")) - message (FATAL_ERROR "HDF5_ALLOW_EXTERNAL_SUPPORT must be set to 'GIT' or 'LOCAL_DIR' to allow building of external HDF5 VOL connectors") + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "NO" OR (NOT HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" AND NOT HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")) + message (FATAL_ERROR "HDF5_VOL_ALLOW_EXTERNAL must be set to 'GIT' or 'LOCAL_DIR' to allow building of external HDF5 VOL connectors") endif() # For compatibility, set some variables that projects would @@ -60,11 +60,11 @@ if (HDF5_VOL_ALLOW_EXTERNAL) math (EXPR vol_idx_len "${vol_idx_len}+1") endwhile () - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build") mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed}) set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}") - elseif(HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build") mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed}) set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}") @@ -72,7 +72,7 @@ if (HDF5_VOL_ALLOW_EXTERNAL) if (NOT "${HDF5_VOL_SOURCE}" STREQUAL "") # Deal with trailing slash in path for LOCAL_DIR case - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") # Erase trailing slash string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE}) endif() @@ -80,11 +80,10 @@ if (HDF5_VOL_ALLOW_EXTERNAL) # Extract the name of the VOL connector string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE) if (hdf5_vol_name_pos EQUAL -1) - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}") - elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}") - else() endif() endif () @@ -99,7 +98,7 @@ if (HDF5_VOL_ALLOW_EXTERNAL) message (VERBOSE "Building VOL connector '${hdf5_vol_name}' with FetchContent from source ${HDF5_VOL_SOURCE}") # Set some cache variables that can be set by users when building - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") set ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH" "main" CACHE STRING "Git branch (or tag) to use when building VOL connector '${hdf5_vol_name}'") mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH") endif() @@ -116,21 +115,21 @@ if (HDF5_VOL_ALLOW_EXTERNAL) endif () endif () - if ((HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") AND ("${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" STREQUAL "")) + if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") AND ("${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" STREQUAL "")) message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_BRANCH must be set to a valid git branch name (or git tag) to build VOL connector '${hdf5_vol_name}'") endif () - if ((HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") AND NOT (EXISTS ${HDF5_VOL_SOURCE} AND IS_DIRECTORY ${HDF5_VOL_SOURCE})) message (FATAL_ERROR "HDF5_VOL_PATH${vol_idx_fixed} must be an absolute path to a valid directory") endif () - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") FetchContent_Declare (HDF5_VOL_${hdf5_vol_name_lower} GIT_REPOSITORY "${HDF5_VOL_SOURCE}" GIT_TAG "${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" ) - elseif(HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") FetchContent_Declare (HDF5_VOL_${hdf5_vol_name_lower} SOURCE_DIR "${HDF5_VOL_SOURCE}" ) @@ -141,9 +140,9 @@ if (HDF5_VOL_ALLOW_EXTERNAL) FetchContent_Populate(HDF5_VOL_${hdf5_vol_name_lower}) if (NOT EXISTS "${hdf5_vol_${hdf5_vol_name_lower}_SOURCE_DIR}/CMakeLists.txt") - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") message (SEND_ERROR "The git repository branch '${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file") - elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "LOCAL_DIR") + elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") message(SEND_ERROR "The local directory '${HDF5_VOL_SOURCE}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file") endif() endif () diff --git a/doc/cmake-vols-fetchcontent.md b/doc/cmake-vols-fetchcontent.md index db9eabd9e69..9d3c1ba85ac 100644 --- a/doc/cmake-vols-fetchcontent.md +++ b/doc/cmake-vols-fetchcontent.md @@ -18,22 +18,18 @@ are the following: ## Building To enable building of an HDF5 VOL connector using HDF5's CMake functionality, -two CMake variables must first be set: +a CMake variable must first be set: - HDF5_VOL_ALLOW_EXTERNAL (Default: OFF) - This variable determines whether or not building of external HDF5 VOL connectors - is enabled. - - HDF5_ALLOW_EXTERNAL_SUPPORT (Default: "NO") + HDF5_VOL_ALLOW_EXTERNAL (Default: "NO") This variable is a string that specifies the manner in which the source code for an external VOL connector will be retrieved. This variable must be set to "GIT" for building external VOL connectors from a Github repository, or set to "LOCAL_DIR" to build from a local source directory. + ### Building -If the `HDF5_VOL_ALLOW_EXTERNAL` option is set to ON and the `HDF5_ALLOW_EXTERNAL_SUPPORT` -variable is set to "GIT", the CMake cache will be populated with a predefined +If the `HDF5_VOL_ALLOW_EXTERNAL` option is set to "GIT", the CMake cache will be populated with a predefined (currently 10) amount of new variables, named: HDF5_VOL_URL01 @@ -54,7 +50,7 @@ functionality to retrieve the source code for a VOL connector pointed to by that URL and will try to build that VOL connector as part of the HDF5 library build process. -If `HDF5_ALLOW_EXTERNAL_SUPPORT` is set to "LOCAL_DIR", then the CMake cache +If `HDF5_VOL_ALLOW_EXTERNAL` is instead set to "LOCAL_DIR", then the CMake cache will instead be populated with the variables: HDF5_VOL_PATH01 @@ -141,8 +137,7 @@ would typically be passed when building HDF5, such as `CMAKE_INSTALL_PREFIX`, -DHDF5_ENABLE_PARALLEL=ON -DALLOW_UNSUPPORTED=ON -DHDF5_TEST_API=ON - -DHDF5_VOL_ALLOW_EXTERNAL=ON - -DHDF5_ALLOW_EXTERNAL_SUPPORT="GIT" + -DHDF5_VOL_ALLOW_EXTERNAL="GIT" -DHDF5_VOL_URL01=https://github.com/hpc-io/vol-async.git -DHDF5_VOL_VOL-ASYNC_BRANCH=develop -DHDF5_VOL_VOL-ASYNC_NAME="async under_vol=0\;under_info={}"