🧰 Adding clang-tidy, cmake-format, and ASAN tests (#168) · Thalhammer/jwt-cpp@3d50121
11cmake_minimum_required(VERSION 3.8)
223-# HUNTER_ENABLED is always set if this package is included in a project using hunter (HunterGate sets it)
4-# In this case we will use hunter as well to stay consistent. If not the use can supply it on configure
5-# to force using hunter.
3+# HUNTER_ENABLED is always set if this package is included in a project using hunter (HunterGate sets it) In this case
4+# we will use hunter as well to stay consistent. If not the use can supply it on configure to force using hunter.
65if(HUNTER_ENABLED)
7- include("cmake/HunterGate.cmake")
8- HunterGate(
9- URL "https://github.com/cpp-pm/hunter/archive/v0.23.314.tar.gz"
10- SHA1 "95c47c92f68edb091b5d6d18924baabe02a6962a"
11- )
12- message(STATUS "jwt-cpp: using hunter for dependency resolution")
6+ include("cmake/HunterGate.cmake")
7+ huntergate(URL "https://github.com/cpp-pm/hunter/archive/v0.23.314.tar.gz" SHA1
8+"95c47c92f68edb091b5d6d18924baabe02a6962a")
9+ message(STATUS "jwt-cpp: using hunter for dependency resolution")
1310endif()
14111512project(jwt-cpp)
@@ -32,23 +29,22 @@ if(NOT JWT_SSL_LIBRARY IN_LIST JWT_SSL_LIBRARY_OPTIONS)
3229 message(FATAL_ERROR "JWT_SSL_LIBRARY must be one of ${JWT_SSL_LIBRARY_OPTIONS}")
3330endif()
343135-# If Hunter is enabled, we configure it to resolve OpenSSL and warn
36-# the user if he selected an option not supported by hunter.
37-# We fall back to the system library in this case.
32+# If Hunter is enabled, we configure it to resolve OpenSSL and warn the user if he selected an option not supported by
33+# hunter. We fall back to the system library in this case.
3834if(HUNTER_ENABLED)
39- if(${JWT_SSL_LIBRARY} MATCHES "OpenSSL")
40- hunter_add_package(OpenSSL)
41- elseif(${JWT_SSL_LIBRARY} MATCHES "LibreSSL")
42- message(WARNING "Hunter does not support LibreSSL yet, the system library will be used (if available)")
43- endif()
44- if(JWT_EXTERNAL_PICOJSON)
45- message(WARNING "Hunter does not support picojson yet, the system library will be used (if available)")
46- endif()
35+ if(${JWT_SSL_LIBRARY} MATCHES "OpenSSL")
36+ hunter_add_package(OpenSSL)
37+ elseif(${JWT_SSL_LIBRARY} MATCHES "LibreSSL")
38+ message(WARNING "Hunter does not support LibreSSL yet, the system library will be used (if available)")
39+ endif()
40+ if(JWT_EXTERNAL_PICOJSON)
41+ message(WARNING "Hunter does not support picojson yet, the system library will be used (if available)")
42+ endif()
4743endif()
4844if(${JWT_SSL_LIBRARY} MATCHES "OpenSSL")
49- find_package(OpenSSL 1.0.2 REQUIRED)
45+ find_package(OpenSSL 1.0.2 REQUIRED)
5046elseif(${JWT_SSL_LIBRARY} MATCHES "LibreSSL")
51- find_package(LibreSSL 3.0.0 REQUIRED)
47+ find_package(LibreSSL 3.0.0 REQUIRED)
5248endif()
53495450if(JWT_EXTERNAL_PICOJSON)