Skip to content

Commit

Permalink
Add 'nng' package (cpp-pm#45)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tnixeu authored and rbsheth committed Oct 25, 2019
1 parent 474082f commit 828a558
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 @@ -363,6 +363,7 @@ hunter_default_version(ncnn VERSION 20180314-p2)
hunter_default_version(ncursesw VERSION 6.1)
hunter_default_version(nlohmann_fifo_map VERSION 0.0.0-0dfbf5d-p1)
hunter_default_version(nlohmann_json VERSION 3.7.0)
hunter_default_version(nng VERSION 1.1.1)
hunter_default_version(nsync VERSION 1.14-p1)
hunter_default_version(odb VERSION 2.4.0)
hunter_default_version(odb-boost VERSION 2.4.0)
Expand Down
33 changes: 33 additions & 0 deletions cmake/projects/nng/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2016-2019, Ruslan Baratov
# 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)

hunter_add_version(
PACKAGE_NAME
nng
VERSION
1.1.1
URL
"https://github.com/nanomsg/nng/archive/v1.1.1.tar.gz"
SHA1
6194ae1187df0ebb2907bb17a8a724496a763bf5
)

hunter_cmake_args(
nng
CMAKE_ARGS
NNG_TOOLS=OFF
NNG_TESTS=OFF
NNG_ENABLE_NNGCAT=OFF
)

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

nng

.. index::
single: unsorted ; nng

.. _pkg.nng:

nng
===

- `Official <https://nanomsg.github.io/nng/index.html>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/nng/CMakeLists.txt>`__
- Added by `tnixeu <https://github.com/tnixeu>`__ (`pr-45 <https://github.com/cpp-pm/hunter/pull/45>`__)

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

cmake_minimum_required(VERSION 3.2)

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

project(download-nng)

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

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC nng::nng)
# DOCUMENTATION_END }
5 changes: 5 additions & 0 deletions examples/nng/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <nng/nng.h>
#include <iostream>
int main() {
std::cout << nng_version() << std::endl;
}

0 comments on commit 828a558

Please sign in to comment.