diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index d01f0acdc6..f8c03d950c 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -510,6 +510,7 @@ hunter_default_version(xtrans VERSION 1.4.0) hunter_default_version(xxf86vm VERSION 1.1.2) hunter_default_version(xxhash VERSION 0.6.5-p0) hunter_default_version(yaml-cpp VERSION 0.6.2-p0) +hunter_default_version(zip VERSION 0.1.15) hunter_default_version(zookeeper VERSION 3.4.9-p2) if(ANDROID) diff --git a/cmake/projects/zip/hunter.cmake b/cmake/projects/zip/hunter.cmake new file mode 100644 index 0000000000..b85535811a --- /dev/null +++ b/cmake/projects/zip/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + zip + VERSION + 0.1.15 + URL + "https://github.com/kuba--/zip/archive/v0.1.15.tar.gz" + SHA1 + f65b4fde71963de6c019413628022d316098c8d1 +) + +hunter_cmake_args( + zip + CMAKE_ARGS + CMAKE_DISABLE_TESTING=ON +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(zip) +hunter_download(PACKAGE_NAME zip) diff --git a/docs/packages/pkg/zip.rst b/docs/packages/pkg/zip.rst new file mode 100644 index 0000000000..5c3fce46d6 --- /dev/null +++ b/docs/packages/pkg/zip.rst @@ -0,0 +1,20 @@ +.. spelling:: + + zip + +.. index:: + single: compression ; zip + +.. _pkg.zip: + +zip +=== + +- `Official `__ +- `Example `__ +- Added by `Rahul Sheth `__ (`pr-1878 `__) + +.. literalinclude:: /../examples/zip/CMakeLists.txt + :language: cmake + :start-after: # DOCUMENTATION_START { + :end-before: # DOCUMENTATION_END } diff --git a/examples/zip/CMakeLists.txt b/examples/zip/CMakeLists.txt new file mode 100644 index 0000000000..01acb0b620 --- /dev/null +++ b/examples/zip/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2016-2019, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.2) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-zip) + +# DOCUMENTATION_START { +hunter_add_package(zip) +find_package(zip CONFIG REQUIRED) + +add_executable(boo boo.cpp) +target_link_libraries(boo PUBLIC zip::zip) +# DOCUMENTATION_END } diff --git a/examples/zip/boo.cpp b/examples/zip/boo.cpp new file mode 100644 index 0000000000..5ddb0a6a78 --- /dev/null +++ b/examples/zip/boo.cpp @@ -0,0 +1,9 @@ +#include + +int main() { + struct zip_t *zip = zip_open("dummy", ZIP_DEFAULT_COMPRESSION_LEVEL, 'w'); + + zip_close(zip); + + return 0; +}