diff --git a/CMakeLists.txt b/CMakeLists.txt index d193ab768..23f2a1f40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,7 @@ option(USE_SYSTEM_SDL2 "Use the system SDL2 lib (instead of the bundled one)" OF option(USE_SYSTEM_BOOST "Use the system Boost libs (instead of the bundled ones)" OFF) option(USE_SYSTEM_OPENSSL "Use the system OpenSSL libs (instead of the bundled LibreSSL)" OFF) option(USE_SYSTEM_LIBUSB "Use the system libusb (instead of the bundled libusb)" OFF) +option(USE_SYSTEM_CPP_JWT "Use the system cpp-jwt (instead of the bundled one)" OFF) option(USE_SYSTEM_SOUNDTOUCH "Use the system SoundTouch (instead of the bundled one)" OFF) if (CITRA_USE_PRECOMPILED_HEADERS) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index f11cb2996..25f864e0f 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -210,9 +210,15 @@ endif() # cpp-jwt if (ENABLE_WEB_SERVICE) - add_library(cpp-jwt INTERFACE) - target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include) - target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON) + if (USE_SYSTEM_CPP_JWT) + find_package(cpp-jwt REQUIRED) + add_library(cpp-jwt INTERFACE) + target_link_libraries(cpp-jwt INTERFACE cpp-jwt::cpp-jwt) + else() + add_library(cpp-jwt INTERFACE) + target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include) + target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON) + endif() endif() # lodepng