add hrantzsch/keychain and link

This commit is contained in:
ouwou 2022-08-08 22:50:27 -04:00
parent 02741f2c1b
commit b46cf53be5
3 changed files with 15 additions and 0 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "subprojects/ixwebsocket"] [submodule "subprojects/ixwebsocket"]
path = subprojects/ixwebsocket path = subprojects/ixwebsocket
url = https://github.com/machinezone/ixwebsocket url = https://github.com/machinezone/ixwebsocket
[submodule "subprojects/keychain"]
path = subprojects/keychain
url = https://github.com/hrantzsch/keychain

View File

@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
option(USE_LIBHANDY "Enable features that require libhandy (default)" ON) 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(nlohmann_json REQUIRED)
find_package(CURL) find_package(CURL)
@ -100,3 +101,13 @@ if (USE_LIBHANDY)
target_compile_definitions(abaddon PRIVATE WITH_LIBHANDY) target_compile_definitions(abaddon PRIVATE WITH_LIBHANDY)
endif () endif ()
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 ()

1
subprojects/keychain Submodule

@ -0,0 +1 @@
Subproject commit 44b517d0962c83cce31c190a6be44c3ddbf52d50