Skip to content

Commit e31fe32

Browse files
authored
Add 'brotli' package (#604)
1 parent f46a461 commit e31fe32

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

cmake/configs/default.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ hunter_default_version(bison VERSION 3.0.4-p0)
211211
hunter_default_version(boost-pba VERSION 1.0.0-p0)
212212
hunter_default_version(botan VERSION 2.11.0-110af9494)
213213
hunter_default_version(breakpad VERSION 0.0.0-12ecff3-p4)
214+
hunter_default_version(brotli VERSION 1.0.9-p0)
214215
hunter_default_version(bullet VERSION 2.87-p0)
215216
hunter_default_version(byte-lite VERSION 0.3.0-p0)
216217
hunter_default_version(c-ares VERSION 1.14.0-p0)

cmake/projects/brotli/hunter.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2016-2020, Rahul Sheth, 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+
brotli
15+
VERSION
16+
1.0.9-p0
17+
URL
18+
"https://github.com/cpp-pm/brotli/archive/v1.0.9-p0.tar.gz"
19+
SHA1
20+
04697e4bb782218ba2a19f3084b3795be8f7b6f1
21+
)
22+
23+
hunter_cmake_args(brotli CMAKE_ARGS
24+
BROTLI_DISABLE_TESTS=YES
25+
BROTLI_BUILD_EXECUTABLE=NO
26+
)
27+
28+
hunter_pick_scheme(DEFAULT url_sha1_cmake)
29+
hunter_cacheable(brotli)
30+
hunter_download(PACKAGE_NAME brotli)

docs/packages/pkg/brotli.rst

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

examples/brotli/CMakeLists.txt

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

examples/brotli/boo.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <brotli/decode.h>
2+
#include <brotli/encode.h>
3+
4+
int main() {
5+
return !(BrotliDecoderVersion() == BrotliEncoderVersion());
6+
}

0 commit comments

Comments
 (0)