Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hdf5] Link zlib using the ZLIB::ZLIB target #18905

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions ports/hdf5/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ vcpkg_from_github(
mingw-import-libs.patch
pkgconfig-requires.patch
pkgconfig-link-order.patch
zlib.patch
)

if ("parallel" IN_LIST FEATURES AND "cpp" IN_LIST FEATURES)
Expand Down
2 changes: 1 addition & 1 deletion ports/hdf5/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hdf5",
"version": "1.12.0",
"port-version": 4,
"port-version": 5,
"description": "HDF5 is a data model, library, and file format for storing and managing data",
"homepage": "https://www.hdfgroup.org/downloads/hdf5/",
"supports": "!uwp",
Expand Down
27 changes: 27 additions & 0 deletions ports/hdf5/zlib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake
index 1ae05eb..3e5824f 100644
--- a/CMakeFilters.cmake
+++ b/CMakeFilters.cmake
@@ -53,6 +53,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
if (NOT ZLIB_FOUND)
find_package (ZLIB) # Legacy find
if (ZLIB_FOUND)
+ set (ZLIB_LIBRARIES ZLIB::ZLIB)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES})
set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES})
set (zlib_PC_LIBS_PRIVATE "${ZLIB_LIBRARIES}")
diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index a8cbacb..9f1a5cf 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -56,6 +56,10 @@ set (${HDF5_PACKAGE_NAME}_PARALLEL_FILTERED_WRITES "@PARALLEL_FILTERED_WRITES@")
#-----------------------------------------------------------------------------
include(CMakeFindDependencyMacro)

+if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT)
+ find_dependency(ZLIB)
+endif()
+
if (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL)
find_dependency(MPI)
set (${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_DIRS@")
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,7 @@
},
"hdf5": {
"baseline": "1.12.0",
"port-version": 4
"port-version": 5
},
"healpix": {
"baseline": "1.12.10",
Expand Down
5 changes: 5 additions & 0 deletions versions/h-/hdf5.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "df1f0132517790601e87da38c4c7f836df7e008e",
"version": "1.12.0",
"port-version": 5
},
{
"git-tree": "77eb81be380363280c67a3b15043696f6cee2001",
"version": "1.12.0",
Expand Down