summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormattjala <124107509+mattjala@users.noreply.github.com>2024-01-04 18:03:50 (GMT)
committerGitHub <noreply@github.com>2024-01-04 18:03:50 (GMT)
commitde3ee47a44ffa7876c1e823eef6045f7fde8e165 (patch)
tree56a7f1dd5638581bc68b9c24a81d2f21068810dd
parent772276ea1f6f8b150a22eff3a908eff24ccc50a7 (diff)
downloadhdf5-de3ee47a44ffa7876c1e823eef6045f7fde8e165.zip
hdf5-de3ee47a44ffa7876c1e823eef6045f7fde8e165.tar.gz
hdf5-de3ee47a44ffa7876c1e823eef6045f7fde8e165.tar.bz2
Fix building VOLs under library with CMake <3.24 (#3920)
* Fix building VOLs under library with CMake <3.24 * Handle CMake version through override variable
-rw-r--r--CMakeVOL.cmake18
1 files changed, 7 insertions, 11 deletions
diff --git a/CMakeVOL.cmake b/CMakeVOL.cmake
index 8b2207a..e089437 100644
--- a/CMakeVOL.cmake
+++ b/CMakeVOL.cmake
@@ -172,20 +172,16 @@ if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" OR HDF5_VOL_ALLOW_EXTERNAL MATCHES "LO
set (hdf5_vol_depname "${HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME}")
string (TOLOWER "${hdf5_vol_depname}" hdf5_vol_depname_lower)
+ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
+ set("OVERRIDE_FIND_PACKAGE_OPT" "OVERRIDE_FIND_PACKAGE")
+ endif()
+
if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
- if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
- FetchContent_Declare (${hdf5_vol_depname}
- GIT_REPOSITORY "${HDF5_VOL_SOURCE}"
- GIT_TAG "${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}"
- OVERRIDE_FIND_PACKAGE
- )
- else ()
- FetchContent_Declare (${hdf5_vol_depname}
+ FetchContent_Declare (${hdf5_vol_depname}
GIT_REPOSITORY "${HDF5_VOL_SOURCE}"
GIT_TAG "${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}"
- FIND_PACKAGE_ARGS NAMES ${hdf5_vol_name_lower}
- )
- endif ()
+ "${OVERRIDE_FIND_PACKAGE_OPT}"
+ )
elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
FetchContent_Declare (${hdf5_vol_depname}
SOURCE_DIR "${HDF5_VOL_SOURCE}"