Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1878 from rbsheth/pr.zip
Browse files Browse the repository at this point in the history
Add 'zip' package
  • Loading branch information
ruslo authored May 24, 2019
2 parents 538642d + 313b9c1 commit c94cc2e
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
31 changes: 31 additions & 0 deletions cmake/projects/zip/hunter.cmake
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 20 additions & 0 deletions docs/packages/pkg/zip.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. spelling::

zip

.. index::
single: compression ; zip

.. _pkg.zip:

zip
===

- `Official <https://https://github.com/kuba--/zip>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/zip/CMakeLists.txt>`__
- Added by `Rahul Sheth <https://github.com/rbsheth>`__ (`pr-1878 <https://github.com/ruslo/hunter/pull/1878>`__)

.. literalinclude:: /../examples/zip/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/zip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 }
9 changes: 9 additions & 0 deletions examples/zip/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <zip/zip.h>

int main() {
struct zip_t *zip = zip_open("dummy", ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');

zip_close(zip);

return 0;
}

0 comments on commit c94cc2e

Please sign in to comment.