Skip to content

Commit

Permalink
Add 'immer' package (#104)
Browse files Browse the repository at this point in the history
* Initial commit

* Add example

* Try first compile

* First working test.

* Fix docu

* Add pull request number

* Fix docu

* Fix docu
  • Loading branch information
Bjoe authored and rbsheth committed Dec 18, 2019
1 parent 37be1a2 commit 9ae97a6
Show file tree
Hide file tree
Showing 5 changed files with 77 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 @@ -77,6 +77,7 @@ hunter_default_version(HastyNoise VERSION 0.8.3)
hunter_default_version(ICU VERSION 63.1-p5)
hunter_default_version(IF97 VERSION 2.1.2)
hunter_default_version(Igloo VERSION 1.1.1-hunter)
hunter_default_version(Immer VERSION 0.6.2-cf44615)
hunter_default_version(Jpeg VERSION 9c-p0)
hunter_default_version(JsonSpirit VERSION 0.0.4-hunter)
hunter_default_version(LAPACK VERSION 3.7.1)
Expand Down
24 changes: 24 additions & 0 deletions cmake/projects/Immer/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
Immer
VERSION
0.6.2-cf44615
URL
"https://github.com/arximboldi/immer/archive/cf446157834335887c2f89418e5dad3d00abfb85.zip"
SHA1
ec88a3d4757c931697f0f9e2aac70e1b50961cf0
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(Immer)
hunter_download(
PACKAGE_NAME Immer
PACKAGE_INTERNAL_DEPS_ID "1"
)
20 changes: 20 additions & 0 deletions docs/packages/pkg/Immer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. spelling::

Immer

.. index::
single: unsorted ; Immer

.. _pkg.Immer:

Immer
=====

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

.. literalinclude:: /../examples/Immer/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/Immer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2016-2018, Ruslan Baratov
# All rights reserved.

cmake_minimum_required(VERSION 3.2)

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

project(immer)

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

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC immer)
# DOCUMENTATION_END }
14 changes: 14 additions & 0 deletions examples/Immer/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <immer/box.hpp>
#include <cassert>
#include <string>

int main()
{
auto v1 = immer::box<std::string>{"hello"};
auto v2 = v1.update([&] (auto l) {
return l + ", world!";
});

assert((v1 == immer::box<std::string>{"hello"}));
assert((v2 == immer::box<std::string>{"hello, world!"}));
}

0 comments on commit 9ae97a6

Please sign in to comment.