Skip to content

Commit 828a558

Browse files
tnixeurbsheth
authored andcommitted
Add 'nng' package (cpp-pm#45)
* adds nng to hunter * adds hunter_cmake_args * adds nng.rst to docs * fix example * inserts PR number and removes developer name * adds developer name again
1 parent 474082f commit 828a558

5 files changed

Lines changed: 77 additions & 0 deletions

File tree

cmake/configs/default.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ hunter_default_version(ncnn VERSION 20180314-p2)
363363
hunter_default_version(ncursesw VERSION 6.1)
364364
hunter_default_version(nlohmann_fifo_map VERSION 0.0.0-0dfbf5d-p1)
365365
hunter_default_version(nlohmann_json VERSION 3.7.0)
366+
hunter_default_version(nng VERSION 1.1.1)
366367
hunter_default_version(nsync VERSION 1.14-p1)
367368
hunter_default_version(odb VERSION 2.4.0)
368369
hunter_default_version(odb-boost VERSION 2.4.0)

cmake/projects/nng/hunter.cmake

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
nng
15+
VERSION
16+
1.1.1
17+
URL
18+
"https://github.com/nanomsg/nng/archive/v1.1.1.tar.gz"
19+
SHA1
20+
6194ae1187df0ebb2907bb17a8a724496a763bf5
21+
)
22+
23+
hunter_cmake_args(
24+
nng
25+
CMAKE_ARGS
26+
NNG_TOOLS=OFF
27+
NNG_TESTS=OFF
28+
NNG_ENABLE_NNGCAT=OFF
29+
)
30+
31+
hunter_pick_scheme(DEFAULT url_sha1_cmake)
32+
hunter_cacheable(nng)
33+
hunter_download(PACKAGE_NAME nng)

docs/packages/pkg/nng.rst

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

examples/nng/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-nng)
11+
12+
# DOCUMENTATION_START {
13+
hunter_add_package(nng)
14+
find_package(nng CONFIG REQUIRED)
15+
16+
add_executable(boo boo.cpp)
17+
target_link_libraries(boo PUBLIC nng::nng)
18+
# DOCUMENTATION_END }

examples/nng/boo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include <nng/nng.h>
2+
#include <iostream>
3+
int main() {
4+
std::cout << nng_version() << std::endl;
5+
}

0 commit comments

Comments
 (0)