-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
135 lines (101 loc) · 3.35 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
project(libusermetrics CXX)
cmake_minimum_required(VERSION 2.8.9)
option (ENABLE_TESTS "Enable testing" ON)
set(API_VERSION 1)
set(ABI_VERSION 1)
set(GETTEXT_PACKAGE libusermetrics)
add_definitions(
-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}"
)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
find_package(PkgConfig REQUIRED)
find_package(Qt5Core REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS})
find_package(Qt5Gui REQUIRED)
include_directories(${Qt5Gui_INCLUDE_DIRS})
find_package(Qt5DBus COMPONENTS Qt5DBusMacros REQUIRED)
include_directories(${Qt5DBus_INCLUDE_DIRS})
find_package(Qt5Sql REQUIRED)
include_directories(${Qt5Sql_INCLUDE_DIRS})
find_package(Qt5XmlPatterns REQUIRED)
include_directories(${Qt5XmlPatterns_INCLUDE_DIRS})
pkg_check_modules(APPARMOR REQUIRED libapparmor REQUIRED)
include_directories(${APPARMOR_INCLUDE_DIRS})
pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt REQUIRED)
include_directories(${GSETTINGS_QT_INCLUDE_DIRS})
find_package(Qt5Test REQUIRED)
include_directories(${Qt5Test_INCLUDE_DIRS})
find_package(Qt5Qml REQUIRED)
include_directories(${Qt5Qml_INCLUDE_DIRS})
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
include_directories(${GLIB2_INCLUDE_DIRS})
pkg_check_modules(GOBJECT2 REQUIRED gobject-2.0)
include_directories(${GOBJECT2_INCLUDE_DIRS})
pkg_check_modules(CLICK REQUIRED click-0.4 REQUIRED)
include_directories(${CLICK_INCLUDE_DIRS})
pkg_check_modules(QDJANGO_DB REQUIRED qdjango-db REQUIRED)
include_directories(${QDJANGO_DB_INCLUDE_DIRS})
pkg_check_modules(QTDBUSTEST REQUIRED libqtdbustest-1 REQUIRED)
include_directories(${QTDBUSTEST_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data")
set(INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(INCLUDE_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
include_directories(${INCLUDE_DIR})
include_directories(${INCLUDE_BINARY_DIR})
set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(SOURCE_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/src")
include(GNUInstallDirs)
# Workaround for libexecdir on debian
if (EXISTS "/etc/debian_version")
set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR})
set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}")
endif()
add_definitions(
-std=c++11
-fno-permissive
-pedantic
-Wall
-Wextra
-DLOCALEDIR="${CMAKE_INSTALL_FULL_DATADIR}/locale"
)
add_subdirectory("doc")
add_subdirectory("po")
add_subdirectory("src")
add_subdirectory("data")
if(ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
ADD_CUSTOM_TARGET(
check
${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
)
find_package(CoverageReport)
enable_coverage_report(
TARGETS
usermetrics-test-utils
usermetricscommon
usermetricsinput
usermetricsinput-static
usermetricsinput-integration-tests
usermetricsinput-unit-tests
usermetricsoutput
usermetricsoutput-integration-tests
usermetricsoutput-static
usermetricsoutput-unit-tests
usermetricsservice
usermetricsservice-bin
usermetricsservice-unit-tests
FILTER
${CMAKE_SOURCE_DIR}/tests/*
${CMAKE_BINARY_DIR}/*
TESTS
usermetrics-test-utils
usermetricsinput-integration-tests
usermetricsinput-unit-tests
usermetricsoutput-integration-tests
usermetricsoutput-unit-tests
usermetricsservice-unit-tests
)
endif()