aboutsummaryrefslogtreecommitdiff
path: root/ports/hdf5/pkgconfig-requires.patch
diff options
context:
space:
mode:
authorKai Pastor <dg0yt@darc.de>2021-06-10 00:17:07 +0200
committerGitHub <noreply@github.com>2021-06-09 15:17:07 -0700
commitc867e68ca880feb5fd01f65c39657b64084b2c2a (patch)
treeae2d4ce2d04207b883c92bc82a24f8837e9cf308 /ports/hdf5/pkgconfig-requires.patch
parent58ce192f0fdd6721d89e248713d44fade6d38768 (diff)
downloadvcpkg-c867e68ca880feb5fd01f65c39657b64084b2c2a.tar.gz
vcpkg-c867e68ca880feb5fd01f65c39657b64084b2c2a.zip
[szip, hdf5] Fix mingw import lib names, control linkage (#17941)
* Format manifest, make port version explicit * Use standard mingw import lib names * Choose either static or shared binaries * Insert macro for dynamic linkage * Add szip pc file * Quote path expressions * Port away from deprecated cmake functions * x-add-version * Begin of hdf5 changes * Remove obsolete variables (complements 23eadeae) * Fix indentation and quoting expressions * Handle single-linkage szip configuration * Use mingw import lib names for hdf5 * Move dependencies to Requires in pc file * Port away from deprecated cmake functions * x-add-version hdf5 * Apply szip review comments * Update version * Improve pkgconfig patch to handle lists * Update git-tree
Diffstat (limited to 'ports/hdf5/pkgconfig-requires.patch')
-rw-r--r--ports/hdf5/pkgconfig-requires.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/ports/hdf5/pkgconfig-requires.patch b/ports/hdf5/pkgconfig-requires.patch
new file mode 100644
index 000000000..5c670b422
--- /dev/null
+++ b/ports/hdf5/pkgconfig-requires.patch
@@ -0,0 +1,51 @@
+diff -urN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2020-03-03 00:03:12.000000000 +0100
++++ b/CMakeLists.txt 2021-05-15 15:02:03.496210691 +0200
+@@ -682,6 +682,9 @@
+ if (MPI_C_LINK_FLAGS)
+ set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
+ endif ()
++ if(UNIX)
++ set(ompi-c_PC_LIBS_PRIVATE ${MPI_C_LIBRARIES})
++ endif()
+ endif ()
+
+ #option (DEFAULT_API_VERSION "Enable v1.12 API (v16, v18, v110, v112)" "v112")
+diff -urN a/CMakeFilters.cmake b/CMakeFilters.cmake
+--- a/CMakeFilters.cmake 2020-03-03 00:03:12.000000000 +0100
++++ b/CMakeFilters.cmake 2021-05-15 12:35:58.453641554 +0200
+@@ -55,6 +55,7 @@
+ if (ZLIB_FOUND)
+ 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}")
+ endif ()
+ endif ()
+ endif ()
+@@ -130,6 +131,7 @@
+ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY})
+ endif ()
+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY})
++ set (szip_PC_LIBS_PRIVATE "${SZIP_STATIC_LIBRARY}")
+ INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS})
+ message (STATUS "Filter SZIP is ON")
+ if (H5_HAVE_FILTER_SZIP)
+diff -urN a/src/CMakeLists.txt b/src/CMakeLists.txt
+--- a/src/CMakeLists.txt 2020-03-03 00:03:12.000000000 +0100
++++ b/src/CMakeLists.txt 2021-05-15 12:41:34.762354040 +0200
+@@ -1259,6 +1259,15 @@
+
+ set (_PKG_CONFIG_REQUIRES)
+ set (_PKG_CONFIG_REQUIRES_PRIVATE)
++set(_PKG_CONFIG_LIBS_PRIVATE " ${_PKG_CONFIG_LIBS_PRIVATE} ")
++foreach(_module IN ITEMS ompi-c szip zlib)
++ if(${_module}_PC_LIBS_PRIVATE)
++ foreach(_lib IN LISTS ${_module}_PC_LIBS_PRIVATE)
++ string(REPLACE " -l${_lib} " " " _PKG_CONFIG_LIBS_PRIVATE "${_PKG_CONFIG_LIBS_PRIVATE}")
++ endforeach()
++ string(APPEND _PKG_CONFIG_REQUIRES_PRIVATE " ${_module}")
++ endif()
++endforeach()
+
+ configure_file (
+ ${HDF_RESOURCES_DIR}/libhdf5.pc.in