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

Commit c94cc2e

Browse files
authored
Merge pull request #1878 from rbsheth/pr.zip
Add 'zip' package
2 parents 538642d + 313b9c1 commit c94cc2e

File tree

5 files changed

+79
-0
lines changed

5 files changed

+79
-0
lines changed

cmake/configs/default.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ hunter_default_version(xtrans VERSION 1.4.0)
510510
hunter_default_version(xxf86vm VERSION 1.1.2)
511511
hunter_default_version(xxhash VERSION 0.6.5-p0)
512512
hunter_default_version(yaml-cpp VERSION 0.6.2-p0)
513+
hunter_default_version(zip VERSION 0.1.15)
513514
hunter_default_version(zookeeper VERSION 3.4.9-p2)
514515

515516
if(ANDROID)

cmake/projects/zip/hunter.cmake

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2016-2019, Ruslan Baratov
2+
# All rights reserved.
3+
4+
# !!! DO NOT PLACE HEADER GUARDS HERE !!!
5+
6+
include(hunter_add_version)
7+
include(hunter_cacheable)
8+
include(hunter_cmake_args)
9+
include(hunter_download)
10+
include(hunter_pick_scheme)
11+
12+
hunter_add_version(
13+
PACKAGE_NAME
14+
zip
15+
VERSION
16+
0.1.15
17+
URL
18+
"https://github.com/kuba--/zip/archive/v0.1.15.tar.gz"
19+
SHA1
20+
f65b4fde71963de6c019413628022d316098c8d1
21+
)
22+
23+
hunter_cmake_args(
24+
zip
25+
CMAKE_ARGS
26+
CMAKE_DISABLE_TESTING=ON
27+
)
28+
29+
hunter_pick_scheme(DEFAULT url_sha1_cmake)
30+
hunter_cacheable(zip)
31+
hunter_download(PACKAGE_NAME zip)

docs/packages/pkg/zip.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. spelling::
2+
3+
zip
4+
5+
.. index::
6+
single: compression ; zip
7+
8+
.. _pkg.zip:
9+
10+
zip
11+
===
12+
13+
- `Official <https://https://github.com/kuba--/zip>`__
14+
- `Example <https://github.com/ruslo/hunter/blob/master/examples/zip/CMakeLists.txt>`__
15+
- Added by `Rahul Sheth <https://github.com/rbsheth>`__ (`pr-1878 <https://github.com/ruslo/hunter/pull/1878>`__)
16+
17+
.. literalinclude:: /../examples/zip/CMakeLists.txt
18+
:language: cmake
19+
:start-after: # DOCUMENTATION_START {
20+
:end-before: # DOCUMENTATION_END }

examples/zip/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2016-2019, Ruslan Baratov
2+
# All rights reserved.
3+
4+
cmake_minimum_required(VERSION 3.2)
5+
6+
# Emulate HunterGate:
7+
# * https://github.com/hunter-packages/gate
8+
include("../common.cmake")
9+
10+
project(download-zip)
11+
12+
# DOCUMENTATION_START {
13+
hunter_add_package(zip)
14+
find_package(zip CONFIG REQUIRED)
15+
16+
add_executable(boo boo.cpp)
17+
target_link_libraries(boo PUBLIC zip::zip)
18+
# DOCUMENTATION_END }

examples/zip/boo.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <zip/zip.h>
2+
3+
int main() {
4+
struct zip_t *zip = zip_open("dummy", ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');
5+
6+
zip_close(zip);
7+
8+
return 0;
9+
}

0 commit comments

Comments
 (0)