summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-02-26 23:06:14 (GMT)
committerGitHub <noreply@github.com>2023-02-26 23:06:14 (GMT)
commitd7128d144b3b44fb7d190d27a61e6fc6c24e10be (patch)
tree4b897947da454745372524a64c3522f04098cf0c /CMakeLists.txt
parent49fdba1091e36df98dd0b2bef2a6246c7372a01b (diff)
downloadhdf5-d7128d144b3b44fb7d190d27a61e6fc6c24e10be.zip
hdf5-d7128d144b3b44fb7d190d27a61e6fc6c24e10be.tar.gz
hdf5-d7128d144b3b44fb7d190d27a61e6fc6c24e10be.tar.bz2
Add fetchcontent for compression libs and fix cmake config (#2487)
* Add fetchcontent for compression libs and fix cmake config * MSDOS is a reserved define name * Add release note and update install doc for FetchContent * Add CI test for FetchContent * Use LINK_COMP_LIBS instead of STATIC_LIBRARY for depends * Use general link
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 5 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c85965..46ef959 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -840,11 +840,11 @@ option (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF)
if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (HDF5_PACKAGE_EXTLIBS)
set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
- if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND)
+ if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND AND NOT BUILD_ZLIB_WITH_FETCHCONTENT)
PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
endif ()
- if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND)
+ if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND AND NOT BUILD_SZIP_WITH_FETCHCONTENT)
PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
endif ()
endif ()
@@ -910,20 +910,12 @@ endif ()
add_subdirectory (src)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
- if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
+ if ((ZLIB_FOUND AND ZLIB_USE_EXTERNAL) OR (SZIP_FOUND AND SZIP_USE_EXTERNAL))
if (NOT ONLY_SHARED_LIBS)
- add_dependencies (${HDF5_LIB_TARGET} HDF5_ZLIB)
+ add_dependencies (${HDF5_LIB_TARGET} ${LINK_COMP_LIBS})
endif ()
if (BUILD_SHARED_LIBS)
- add_dependencies (${HDF5_LIBSH_TARGET} HDF5_ZLIB)
- endif ()
- endif ()
- if (SZIP_FOUND AND SZIP_USE_EXTERNAL)
- if (NOT ONLY_SHARED_LIBS)
- add_dependencies (${HDF5_LIB_TARGET} SZIP)
- endif ()
- if (BUILD_SHARED_LIBS)
- add_dependencies (${HDF5_LIBSH_TARGET} SZIP)
+ add_dependencies (${HDF5_LIBSH_TARGET} ${LINK_COMP_LIBS})
endif ()
endif ()
endif ()