From c9ef90d1434db1784ad24106f4dcbc9853d5ec91 Mon Sep 17 00:00:00 2001 From: Dominik Date: Sat, 30 May 2020 22:13:02 +0200 Subject: [PATCH 1/2] Add cmake option to disable picojson install. see #68 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7215a8d..be11752 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ endif() option(BUILD_TESTS "Configure CMake to build tests (or not)" ON) option(EXTERNAL_PICOJSON "Use find_package() to locate the picojson header" OFF) +option(NO_INSTALL_PICOJSON "Do not install the picojson header" OFF) project(jwt-cpp) @@ -49,7 +50,7 @@ write_basic_package_version_file( COMPATIBILITY ExactVersion) install(FILES ${JWT_HEADERS} DESTINATION include/jwt-cpp) -if(NOT EXTERNAL_PICOJSON) +if(NOT EXTERNAL_PICOJSON AND NOT NO_INSTALL_PICOJSON) install(FILES ${PICO_HEADER} DESTINATION include/picojson) endif() From 602868558a80f9e04d0ae5e8348555fee8f7e86d Mon Sep 17 00:00:00 2001 From: Fausto Carvalho Date: Sat, 30 May 2020 21:54:01 -0300 Subject: [PATCH 2/2] Adds a find_package to GTest when tests are ON. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index be11752..5d31c72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,11 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(OpenSSL 1.0.2 REQUIRED) + +if(BUILD_TESTS) + find_package(GTest REQUIRED) +endif() + if(EXTERNAL_PICOJSON) find_package(picojson REQUIRED) endif()