diff options
| author | Kai Pastor <dg0yt@darc.de> | 2021-07-27 01:54:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-26 16:54:30 -0700 |
| commit | 7dbc05515b44bf54d2a42b4da9d1e1f910868b86 (patch) | |
| tree | 20439139743ba75dba05892145ebf10b33424a6d /ports/zlib | |
| parent | f6e78c3d87b17d7e9cbbae69902501c7e7870ac9 (diff) | |
| download | vcpkg-7dbc05515b44bf54d2a42b4da9d1e1f910868b86.tar.gz vcpkg-7dbc05515b44bf54d2a42b4da9d1e1f910868b86.zip | |
[zlib] Add cmake wrapper (#18914)
* Format manifest
* Add cmake wrapper
* x-add-version
* Always use vcpkg zlib for sentry native
* x-add-version
* Fix and simplify wrapper
* Update git-tree
Diffstat (limited to 'ports/zlib')
| -rw-r--r-- | ports/zlib/CONTROL | 5 | ||||
| -rw-r--r-- | ports/zlib/portfile.cmake | 1 | ||||
| -rw-r--r-- | ports/zlib/vcpkg-cmake-wrapper.cmake | 13 | ||||
| -rw-r--r-- | ports/zlib/vcpkg.json | 7 |
4 files changed, 21 insertions, 5 deletions
diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL deleted file mode 100644 index a4c1a55d6..000000000 --- a/ports/zlib/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: zlib -Version: 1.2.11 -Port-Version: 10 -Homepage: https://www.zlib.net/ -Description: A compression library diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 429d85440..572eb0907 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -31,6 +31,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) # Install the pkgconfig file if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") diff --git a/ports/zlib/vcpkg-cmake-wrapper.cmake b/ports/zlib/vcpkg-cmake-wrapper.cmake new file mode 100644 index 000000000..5060c5502 --- /dev/null +++ b/ports/zlib/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,13 @@ +set(ZLIB_ROOT "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
+find_path(ZLIB_INCLUDE_DIR NAMES zlib.h PATHS "${ZLIB_ROOT}/include" NO_DEFAULT_PATH)
+find_library(ZLIB_LIBRARY_RELEASE NAMES zlib z PATHS "${ZLIB_ROOT}/lib" NO_DEFAULT_PATH)
+find_library(ZLIB_LIBRARY_DEBUG NAMES zlibd z PATHS "${ZLIB_ROOT}/debug/lib" NO_DEFAULT_PATH)
+if(NOT ZLIB_INCLUDE_DIR OR NOT ZLIB_LIBRARY_RELEASE OR (NOT ZLIB_LIBRARY_DEBUG AND EXISTS "${ZLIB_ROOT}/debug/lib"))
+ message("Broken installation of vcpkg port zlib")
+endif()
+if(CMAKE_VERSION VERSION_LESS 3.4)
+ include(SelectLibraryConfigurations)
+ select_library_configurations(ZLIB)
+ unset(ZLIB_FOUND)
+endif()
+_find_package(${ARGS})
diff --git a/ports/zlib/vcpkg.json b/ports/zlib/vcpkg.json new file mode 100644 index 000000000..39457efec --- /dev/null +++ b/ports/zlib/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "zlib", + "version-string": "1.2.11", + "port-version": 11, + "description": "A compression library", + "homepage": "https://www.zlib.net/" +} |
