Skip to content

Commit 4d04a0e

Browse files
Thalhammerrbsheth
andauthored
Add 'jwt-cpp' package (#467)
* Add 'jwt-cpp' package * Pull request number * Move version entry * Testing * Fix include name * Update jwt-cpp.rst * Update jwt-cpp.rst Co-authored-by: Rahul Sheth <rahul@snap.com>
1 parent e92618b commit 4d04a0e

File tree

5 files changed

+77
-0
lines changed

5 files changed

+77
-0
lines changed

cmake/configs/default.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ else()
344344
hunter_default_version(jsoncpp VERSION 1.9.5-b1)
345345
endif()
346346

347+
hunter_default_version(jwt-cpp VERSION 0.5.2)
347348
hunter_default_version(kNet VERSION 2.7-p1)
348349
hunter_default_version(kbproto VERSION 1.0.7)
349350
hunter_default_version(lcms VERSION 2.9-p0)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) 2016-2020, Rahul Sheth, 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_download)
9+
include(hunter_pick_scheme)
10+
include(hunter_cmake_args)
11+
12+
hunter_add_version(
13+
PACKAGE_NAME
14+
jwt-cpp
15+
VERSION
16+
0.5.2
17+
URL
18+
"https://github.com/Thalhammer/jwt-cpp/archive/refs/tags/v0.5.2.tar.gz"
19+
SHA1
20+
528c0c23ec9d9e5af06770e4a0bc931a94a30a51
21+
)
22+
23+
hunter_cmake_args(
24+
jwt-cpp
25+
CMAKE_ARGS
26+
JWT_BUILD_EXAMPLES=OFF
27+
JWT_BUILD_TESTS=OFF
28+
JWT_ENABLE_COVERAGE=OFF
29+
)
30+
31+
hunter_pick_scheme(DEFAULT url_sha1_cmake)
32+
hunter_cacheable(jwt-cpp)
33+
hunter_download(PACKAGE_NAME jwt-cpp)

docs/packages/pkg/jwt-cpp.rst

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

examples/jwt-cpp/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2016-2020, Rahul Sheth, 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-jwt-cpp)
11+
12+
# DOCUMENTATION_START {
13+
hunter_add_package(jwt-cpp)
14+
find_package(jwt-cpp CONFIG REQUIRED)
15+
16+
add_executable(sample main.cpp)
17+
target_link_libraries(sample PUBLIC jwt-cpp::jwt-cpp)
18+
# DOCUMENTATION_END }

examples/jwt-cpp/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include <jwt-cpp/jwt.h>
2+
3+
int main() {
4+
}

0 commit comments

Comments
 (0)