File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,16 @@ set(HDF5_INCLUDE_DIRS ${CMAKE_INSTALL_FULL_INCLUDEDIR})
3232file (READ ${CMAKE_CURRENT_LIST_DIR} /libraries.json json)
3333
3434# --- Zlib
35+ if (build_zlib)
36+ set (zlib_dep DEPENDS ZLIB)
3537if (TARGET ZLIB::ZLIB)
3638 add_custom_target (ZLIB)
3739else ()
3840 include (${CMAKE_CURRENT_LIST_DIR} /zlib.cmake)
3941endif ()
42+ else ()
43+ set (zlib_dep)
44+ endif ()
4045
4146# --- HDF5
4247# https://forum.hdfgroup.org/t/issues-when-using-hdf5-as-a-git-submodule-and-using-cmake-with-add-subdirectory/7189/2
@@ -76,6 +81,10 @@ endif()
7681
7782if (hdf5_url MATCHES "hdf5_([0-9]+\. [0-9]+\. [0-9]+)\. " )
7883 set (HDF5_VERSION "${CMAKE_MATCH_1} " )
84+ elseif (hdf5_url MATCHES "hdf5-([0-9]+\_ [0-9]+\_ [0-9]+)" )
85+ string (REPLACE "_" "." HDF5_VERSION "${CMAKE_MATCH_1} " )
86+ else ()
87+ message (FATAL_ERROR "Could not determine HDF5 version from URL: ${hdf5_url} " )
7988endif ()
8089
8190message (STATUS "Building HDF5 version ${HDF5_VERSION} " )
@@ -84,7 +93,7 @@ ExternalProject_Add(HDF5
8493URL ${hdf5_url}
8594CMAKE_ARGS ${hdf5_cmake_args}
8695BUILD_BYPRODUCTS ${HDF5_LIBRARIES}
87- DEPENDS ZLIB
96+ ${zlib_dep}
8897CONFIGURE_HANDLED_BY_BUILD ON
8998USES_TERMINAL_DOWNLOAD true
9099USES_TERMINAL_UPDATE true
Original file line number Diff line number Diff line change 66 "url" : " https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.2.tar.gz"
77 },
88 "hdf5" : {
9- "url" : " https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_1.14.5 .tar.gz"
9+ "url" : " https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_10_11 .tar.gz"
1010 }
1111}
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ LANGUAGES C Fortran
77
88option (hdf5_parallel "build HDF5 parallel MPI" )
99option (zlib_legacy "use legacy zlib 1.x" )
10+ option (build_zlib "build zlib" )
1011
1112# --- system checks
1213message (STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} " )
You can’t perform that action at this time.
0 commit comments