aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/hdf5-config-dependencies.patch
blob: cf448dac44a6e80dd46d650895dbeffda0273e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
The installed CMake configuration is missing targets for zlib and
libaec. Taken from
https://github.com/microsoft/vcpkg/blob/e36fe7110deac47a3aff8eda3dcc7cfb894a2ebf/ports/hdf5/hdf5_config.patch

diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index 1a3fb7bbf2..79081ce040 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -120,12 +114,22 @@ set (${HDF5_PACKAGE_NAME}_VERSION_MINOR  @HDF5_VERSION_MINOR@)
 # Don't include targets if this file is being picked up by another
 # project which has already built hdf5 as a subproject
 #-----------------------------------------------------------------------------
+include(CMakeFindDependencyMacro)
 if (NOT TARGET "@HDF5_PACKAGE@")
   if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS)
     include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+  elseif (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT)
+    find_dependency(ZLIB)
   endif ()
   if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS)
     include (@PACKAGE_SHARE_INSTALL_DIR@/@LIBAEC_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+  elseif (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT)
+    if (${HDF5_PACKAGE_NAME}_BUILD_STATIC_LIBS)
+      set(libaec_USE_STATIC_LIBS ON)
+    else()
+      set(libaec_USE_STATIC_LIBS OFF)
+    endif()
+    find_dependency(libaec)
   endif ()
   include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
 endif ()