1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-23 12:57:45 +00:00
astra/external/libcotp/CMakeLists.txt
Joshua Goins 5ee036dd09 Add option to generate OTP codes automatically
* This uses the great libcotp library, I stripped it down to fit inside
the repository.
* This is a security-convenience trade-off, and it's made very clear
with the tooltips on the settings page.
* It's still secured by your system keychain, and it's up to the users
whether that's good enough for them. Eventually down the line
I would like to support more esoteric keychains such as Bitwarden or
KeePass.
* Right now it's only integrated into the auto-login desktop feature,
but there will eventually be like an "auto-fill OTP" button in the main
window.

There's still a lot to clean up with these new features but they work
a little at least :-)
2022-08-31 21:19:25 -04:00

34 lines
No EOL
966 B
CMake

cmake_minimum_required(VERSION 3.5)
project(cotp)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
find_package(Gcrypt 1.6.0 REQUIRED)
include_directories(${GCRYPT_INCLUDE_DIR})
link_directories(${GCRYPT_LIBRARY_DIRS})
# set up versioning.
set(BUILD_MAJOR "1")
set(BUILD_MINOR "2")
set(BUILD_VERSION "6")
set(BUILD_VERSION ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_VERSION})
set(CMAKE_C_STANDARD 11)
set(COTP_HEADERS src/cotp.h)
set(SOURCE_FILES src/otp.c)
set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
add_library(cotp SHARED ${SOURCE_FILES})
target_link_libraries(cotp ${GCRYPT_LIBRARIES} baseencode)
target_include_directories(cotp PUBLIC src)
set_target_properties(cotp PROPERTIES VERSION ${BUILD_VERSION} SOVERSION ${BUILD_MAJOR}${BUILD_MINOR})