diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index aacffd2e8..512381a33 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -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) @@ -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) diff --git a/cmake/projects/Zug/hunter.cmake b/cmake/projects/Zug/hunter.cmake new file mode 100644 index 000000000..32a10e884 --- /dev/null +++ b/cmake/projects/Zug/hunter.cmake @@ -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" +) diff --git a/cmake/projects/zstd/hunter.cmake b/cmake/projects/zstd/hunter.cmake new file mode 100644 index 000000000..e9af78eec --- /dev/null +++ b/cmake/projects/zstd/hunter.cmake @@ -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) + diff --git a/docs/packages/pkg/Zug.rst b/docs/packages/pkg/Zug.rst new file mode 100644 index 000000000..6b7d199db --- /dev/null +++ b/docs/packages/pkg/Zug.rst @@ -0,0 +1,20 @@ +.. spelling:: + + Zug + +.. index:: + single: unsorted ; Zug + +.. _pkg.Zug: + +Zug +=== + +- `Official `__ +- `Example `__ +- Added by `Joerg-Christian Boehme `__ (`pr-107 `__) + +.. literalinclude:: /../examples/Zug/CMakeLists.txt + :language: cmake + :start-after: # DOCUMENTATION_START { + :end-before: # DOCUMENTATION_END } diff --git a/docs/packages/pkg/zstd.rst b/docs/packages/pkg/zstd.rst new file mode 100644 index 000000000..71161116f --- /dev/null +++ b/docs/packages/pkg/zstd.rst @@ -0,0 +1,24 @@ +.. spelling:: + + zstd + libzstd_shared + +.. index:: compression ; zstd + +.. _pkg.zstd: + +zstd +==== + +- `Official `__ +- `Example `__ + +.. 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`. diff --git a/examples/Zug/CMakeLists.txt b/examples/Zug/CMakeLists.txt new file mode 100644 index 000000000..2be3ab4c5 --- /dev/null +++ b/examples/Zug/CMakeLists.txt @@ -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 } diff --git a/examples/Zug/boo.cpp b/examples/Zug/boo.cpp new file mode 100644 index 000000000..f52ec597b --- /dev/null +++ b/examples/Zug/boo.cpp @@ -0,0 +1,20 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +using namespace zug; + +int main() { + auto input = std::stringstream{"1 2 3 4 5"}; + auto output = std::stringstream{}; + + run(comp(read(input), write(output, ';'))); + std::cout << output.str(); + return 0; +} diff --git a/examples/zstd/CMakeLists.txt b/examples/zstd/CMakeLists.txt new file mode 100644 index 000000000..2fe626fe9 --- /dev/null +++ b/examples/zstd/CMakeLists.txt @@ -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) diff --git a/examples/zstd/foo.c b/examples/zstd/foo.c new file mode 100644 index 000000000..6cadd8a8e --- /dev/null +++ b/examples/zstd/foo.c @@ -0,0 +1,7 @@ +#include + +int main() { + ZSTD_DCtx *_decompression_ctx = ZSTD_createDCtx(); + ZSTD_freeDCtx(_decompression_ctx); + return 0; +}