Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmake/recipes/hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ option(HDF5_TEST_TOOLS "" OFF)
option(HDF5_TEST_VFD "" OFF)
option(HDF5_ENABLE_ALL_WARNINGS "" OFF)
option(HDF5_ENABLE_EMBEDDED_LIBINFO "" OFF)

# Tell hdf5 to use our zlib. See config/HDF5UseZLIB.cmake in hdf5 for exact logic.
include(zlib_static)
set(H5_ZLIB_HEADER "zlib.h")
set(ZLIB_FOUND TRUE)

#To prevent changes in the oput dirs
set (HDF5_EXTERNALLY_CONFIGURED 1)

Expand All @@ -46,5 +52,6 @@ set(HDF5_RELEASE_TAG hdf5-1_14_3)
#we fetch the zip file to get prebuilt files (and avoid a perl dependency)
CPMAddPackage("https://github.com/HDFGroup/hdf5/releases/download/${HDF5_RELEASE_TAG}/${HDF5_RELEASE_TAG}.zip")

target_link_libraries(hdf5-static PUBLIC ZLIB::ZLIBSTATIC)
target_link_libraries(hdf5-static INTERFACE hdf5_hl-static)
add_library(hdf5::hdf5 ALIAS hdf5-static)
13 changes: 13 additions & 0 deletions cmake/recipes/zlib_static.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# zlib (https://github.com/madler/zlib)
# License: zlib

if(TARGET ZLIB::ZLIBSTATIC)
return()
endif()

message(STATUS "Third-party: creating target 'ZLIB::ZLIBSTATIC'")

set(ZLIB_BUILD_TESTING OFF)

include(CPM)
CPMAddPackage("gh:madler/zlib@1.3.2")
Loading