-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
41 lines (31 loc) · 1.04 KB
/
CMakeLists.txt
File metadata and controls
41 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.22.1)
project(cotpy C)
include(GNUInstallDirs)
set(CMAKE_C_STANDARD 17)
set(HEADERS_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
set(LIBRARY_DESTINATION ${CMAKE_INSTALL_LIBDIR})
set(CMAKE_C_FLAGS "-O3 -fmessage-length=0 -Wall -Werror -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wwrite-strings")
set(SOURCE_ROOT "src")
set(OPENSSL_USE_STATIC_LIBS TRUE)
find_package(OpenSSL REQUIRED)
add_library(cotpy STATIC
${SOURCE_ROOT}/cotpy.h
${SOURCE_ROOT}/cotpy_types.h
${SOURCE_ROOT}/cotpy.c
src/otpauth.c
src/otpauth.h
src/otp.c
src/otp.h
)
set(PUBLIC_HEADERS
${SOURCE_ROOT}/cotpy.h
${SOURCE_ROOT}/cotpy_types.h
)
set_target_properties(cotpy PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
target_link_libraries(cotpy OpenSSL::Crypto encode uri_encode)
install(
TARGETS cotpy
PUBLIC_HEADER DESTINATION ${HEADERS_DESTINATION}
LIBRARY DESTINATION ${LIBRARY_DESTINATION}
ARCHIVE DESTINATION ${LIBRARY_DESTINATION}
)