From b46cf53be5e0eaf37cf81192fa4e475ed3502601 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 8 Aug 2022 22:50:27 -0400 Subject: [PATCH] add hrantzsch/keychain and link --- .gitmodules | 3 +++ CMakeLists.txt | 11 +++++++++++ subprojects/keychain | 1 + 3 files changed, 15 insertions(+) create mode 160000 subprojects/keychain diff --git a/.gitmodules b/.gitmodules index 17c4c23..d091843 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "subprojects/ixwebsocket"] path = subprojects/ixwebsocket url = https://github.com/machinezone/ixwebsocket +[submodule "subprojects/keychain"] + path = subprojects/keychain + url = https://github.com/hrantzsch/keychain diff --git a/CMakeLists.txt b/CMakeLists.txt index 44ca621..901b370 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") option(USE_LIBHANDY "Enable features that require libhandy (default)" ON) +option(USE_KEYCHAIN "Store the token in the keychain (default)" ON) find_package(nlohmann_json REQUIRED) find_package(CURL) @@ -100,3 +101,13 @@ if (USE_LIBHANDY) target_compile_definitions(abaddon PRIVATE WITH_LIBHANDY) endif () endif () + +if (USE_KEYCHAIN) + find_package(keychain QUIET) + if (NOT keychain_FOUND) + message("keychain was not found and will be included as a submodule") + add_subdirectory(subprojects/keychain) + target_link_libraries(abaddon keychain) + target_compile_definitions(abaddon PRIVATE WITH_KEYCHAIN) + endif () +endif () diff --git a/subprojects/keychain b/subprojects/keychain new file mode 160000 index 0000000..44b517d --- /dev/null +++ b/subprojects/keychain @@ -0,0 +1 @@ +Subproject commit 44b517d0962c83cce31c190a6be44c3ddbf52d50