mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
Allow building examples as subproject and build them by default (#84)
This commit is contained in:
committed by
GitHub
parent
d2223db256
commit
312cb9d74c
@@ -5,6 +5,7 @@ if(CMAKE_TOOLCHAIN_FILE)
|
||||
endif()
|
||||
|
||||
option(BUILD_TESTS "Configure CMake to build tests (or not)" ON)
|
||||
option(BUILD_EXAMPLES "Configure CMake to build examples (or not)" ON)
|
||||
option(COVERAGE "Enable code coverage testing" OFF)
|
||||
option(EXTERNAL_PICOJSON "Use find_package() to locate the picojson header" OFF)
|
||||
option(DISABLE_JWT_CPP_BASE64
|
||||
@@ -93,3 +94,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jwt-cpp-config.cmake
|
||||
if(BUILD_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if(BUILD_EXAMPLES)
|
||||
add_subdirectory(example)
|
||||
endif()
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
project(jwt-cpp-examples)
|
||||
find_package(jwt-cpp CONFIG REQUIRED)
|
||||
if(NOT TARGET jwt-cpp)
|
||||
find_package(jwt-cpp CONFIG REQUIRED)
|
||||
endif()
|
||||
|
||||
add_executable(print-claims print-claims.cpp)
|
||||
target_link_libraries(print-claims jwt-cpp::jwt-cpp)
|
||||
|
||||
Reference in New Issue
Block a user