-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
80 lines (62 loc) · 1.9 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
project(libqtdbustest CXX)
cmake_minimum_required(VERSION 2.8.9)
set(API_VERSION 1)
set(ABI_VERSION 1)
set(GETTEXT_PACKAGE libqtdbustest)
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(Qt5DBus COMPONENTS Qt5DBusMacros REQUIRED)
include_directories(${Qt5DBus_INCLUDE_DIRS})
find_package(Qt5Test REQUIRED)
include_directories(${Qt5Test_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(DATA_DIR "${CMAKE_SOURCE_DIR}/data")
set(SOURCE_DIR "${CMAKE_SOURCE_DIR}/src")
set(SOURCE_BINARY_DIR "${CMAKE_BINARY_DIR}/src")
include_directories(${SOURCE_DIR})
include_directories(${SOURCE_BINARY_DIR})
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()
set(LOCALE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/locale")
set(DBUS_SYSTEM_CONFIG_FILE "${CMAKE_INSTALL_FULL_DATADIR}/libqtdbustest/system.conf")
set(DBUS_SESSION_CONFIG_FILE "${CMAKE_INSTALL_FULL_DATADIR}/libqtdbustest/session.conf")
set(QTDBUSTEST_WATCHDOG_BIN "${CMAKE_INSTALL_FULL_LIBEXECDIR}/libqtdbustest/watchdog")
add_definitions(
-std=c++11
-fno-permissive
-pedantic
-Wall
-Wextra
)
configure_file(
"${SOURCE_DIR}/libqtdbustest/config.h.in"
"${SOURCE_BINARY_DIR}/libqtdbustest/config.h"
)
add_subdirectory("src")
add_subdirectory("data")
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
qtdbustest
qdbus-simple-test-runner
unit-tests
watchdog
FILTER
${CMAKE_SOURCE_DIR}/tests/*
${CMAKE_BINARY_DIR}/*
TESTS
unit-tests
)