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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pkg.template
Browse files Browse the repository at this point in the history
  • Loading branch information
rbsheth committed Dec 20, 2019
2 parents d3a14df + 08b2134 commit 9e6215e
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ hunter_default_version(YAJL VERSION 2.1.0-p0)
hunter_default_version(ZLIB VERSION 1.2.11-p1)
hunter_default_version(ZMQPP VERSION 4.2.0-p0)
hunter_default_version(ZeroMQ VERSION 4.2.3-p1)
hunter_default_version(Zug VERSION 0.0.1-be20cae)

hunter_default_version(acf VERSION 0.1.14)
hunter_default_version(actionlib VERSION 1.11.13-p0)
Expand Down Expand Up @@ -535,6 +536,7 @@ hunter_default_version(xxhash VERSION 0.6.5-p0)
hunter_default_version(yaml-cpp VERSION 0.6.2-0f9a586-p1)
hunter_default_version(zip VERSION 0.1.15)
hunter_default_version(zookeeper VERSION 3.4.9-p2)
hunter_default_version(zstd VERSION 1.4.5-d73e2fb-p0)

if(ANDROID)
string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "" _is_empty)
Expand Down
24 changes: 24 additions & 0 deletions cmake/projects/Zug/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
PACKAGE_NAME
Zug
VERSION
0.0.1-be20cae
URL
"https://github.com/arximboldi/zug/archive/be20cae36e7e5876bf5bfb08b2a0562e1db3b546.zip"
SHA1
2d129f233691e0abca99e039bbe66e46e0be74a1
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(Zug)
hunter_download(
PACKAGE_NAME Zug
PACKAGE_INTERNAL_DEPS_ID "1"
)
33 changes: 33 additions & 0 deletions cmake/projects/zstd/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2019 Niall Douglas https://www.nedproductions.biz/
# 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)
include(hunter_source_subdir)

hunter_add_version(
PACKAGE_NAME
zstd
VERSION
1.4.5-d73e2fb-p0
URL
"https://github.com/facebook/zstd/archive/d73e2fb465c9289f5a6871cef1fe48de917a5cc2.tar.gz"
SHA1
e770f4ff39ca7b40790e2fe61339cc84b63c0a8d
)

hunter_source_subdir(zstd SOURCE_SUBDIR "build/cmake")

hunter_cmake_args(zstd CMAKE_ARGS
ZSTD_BUILD_PROGRAMS=OFF
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(zstd)
hunter_download(PACKAGE_NAME zstd)

20 changes: 20 additions & 0 deletions docs/packages/pkg/Zug.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. spelling::

Zug

.. index::
single: unsorted ; Zug

.. _pkg.Zug:

Zug
===

- `Official <https://github.com/arximboldi/zug>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/Zug/CMakeLists.txt>`__
- Added by `Joerg-Christian Boehme <https://github.com/Bjoe>`__ (`pr-107 <https://github.com/ruslo/hunter/pull/107>`__)

.. literalinclude:: /../examples/Zug/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
24 changes: 24 additions & 0 deletions docs/packages/pkg/zstd.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. spelling::

zstd
libzstd_shared

.. index:: compression ; zstd

.. _pkg.zstd:

zstd
====

- `Official <https://github.com/facebook/zstd>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/zstd/CMakeLists.txt>`__

.. code-block:: cmake
find_package(Threads REQUIRED)
hunter_add_package(zstd)
find_package(zstd CONFIG REQUIRED)
target_link_libraries(... zstd::libzstd_static Threads::Threads)
`zstd::libzstd_shared` target is also available. It will already be
linked with `Threads::Threads`.
21 changes: 21 additions & 0 deletions examples/Zug/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c)
# All rights reserved.

cmake_minimum_required(VERSION 3.2)

# Emulate HunterGate:
# * https://github.com/cpp-pm/gate
include("../common.cmake")

project(Zug)

# DOCUMENTATION_START {
hunter_add_package(Boost)
find_package(Boost CONFIG REQUIRED)

hunter_add_package(Zug)
find_package(Zug CONFIG REQUIRED)

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC zug Boost::boost)
# DOCUMENTATION_END }
20 changes: 20 additions & 0 deletions examples/Zug/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <zug/compose.hpp>
#include <zug/run.hpp>
#include <zug/transducer/map.hpp>
#include <zug/transducer/read.hpp>
#include <zug/transducer/write.hpp>

#include <sstream>
#include <vector>
#include <iostream>

using namespace zug;

int main() {
auto input = std::stringstream{"1 2 3 4 5"};
auto output = std::stringstream{};

run(comp(read<int>(input), write(output, ';')));
std::cout << output.str();
return 0;
}
20 changes: 20 additions & 0 deletions examples/zstd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2019 Niall Douglas
# All rights reserved.

cmake_minimum_required(VERSION 3.0)

# Emulate HunterGate:
# * https://github.com/cpp-pm/gate
include("../common.cmake")

project(download-zstd)
find_package(Threads REQUIRED)

hunter_add_package(zstd)
find_package(zstd CONFIG REQUIRED)

add_executable(foo-static foo.c)
target_link_libraries(foo-static PUBLIC zstd::libzstd_static Threads::Threads)

add_executable(foo-shared foo.c)
target_link_libraries(foo-shared PUBLIC zstd::libzstd_shared)
7 changes: 7 additions & 0 deletions examples/zstd/foo.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <zstd.h>

int main() {
ZSTD_DCtx *_decompression_ctx = ZSTD_createDCtx();
ZSTD_freeDCtx(_decompression_ctx);
return 0;
}

0 comments on commit 9e6215e

Please sign in to comment.