This repository has been archived by the owner on Nov 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
75 lines (65 loc) · 1.79 KB
/
CMakeLists.txt
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
project(authenticator-ng LANGUAGES C CXX)
cmake_minimum_required(VERSION 2.8.9)
enable_testing()
set(GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME})
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 14)
include(GNUInstallDirs)
if(EXISTS "/etc/debian_version")
execute_process(
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
OUTPUT_VARIABLE ARCH_TRIPLET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CMAKE_INSTALL_LIBDIR lib/${ARCH_TRIPLET})
set(CMAKE_INSTALL_LIBEXECDIR "${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
if(CLICK_MODE)
set(CMAKE_INSTALL_PREFIX /)
set(CMAKE_INSTALL_BINDIR lib/${ARCH_TRIPLET}/bin)
endif(CLICK_MODE)
endif(EXISTS "/etc/debian_version")
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
pkg_check_modules(AUTH_STATIC REQUIRED
zbar
)
pkg_check_modules(AUTH_DYNAMIC REQUIRED
libcrypto
libjpeg
libv4l2
)
include_directories(SYSTEM
${AUTH_STATIC_INCLUDE_DIRS}
${AUTH_DYNAMIC_INCLUDE_DIRS}
)
configure_file(manifest.json.in manifest.json)
if(CLICK_MODE)
install(FILES
${CMAKE_PROJECT_NAME}.desktop
${CMAKE_PROJECT_NAME}.svg
${CMAKE_PROJECT_NAME}.json
${CMAKE_CURRENT_BINARY_DIR}/manifest.json
DESTINATION .
)
else(CLICK_MODE)
install(
FILES ${CMAKE_PROJECT_NAME}.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
)
install(
FILES ${CMAKE_PROJECT_NAME}.svg
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps
)
endif(CLICK_MODE)
add_subdirectory(liboath)
add_subdirectory(app)
add_subdirectory(po)
find_package(CoverageReport)
enable_coverage_report(
TARGETS liboath authenticator-ng
TESTS ${COVERAGE_TEST_TARGETS}
FILTER /usr/include ${CMAKE_BINARY_DIR}/*
)