forked from mzanetti/guh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
guh.pri
97 lines (73 loc) · 3.32 KB
/
guh.pri
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
# Parse and export GUH_VERSION_STRING
GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
# Install path for plugins
GUH_PLUGINS_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/guh/plugins/
# define protocol versions
JSON_PROTOCOL_VERSION_MAJOR=0
JSON_PROTOCOL_VERSION_MINOR=54
REST_API_VERSION=1
DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" \
JSON_PROTOCOL_VERSION=\\\"$${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}\\\" \
REST_API_VERSION=\\\"$${REST_API_VERSION}\\\" \
GUH_PLUGINS_PATH=\\\"$${GUH_PLUGINS_PATH}\\\"
QT *= network websockets bluetooth dbus
QMAKE_CXXFLAGS *= -Werror -std=c++11 -g
QMAKE_LFLAGS *= -std=c++11
top_srcdir=$$PWD
top_builddir=$$shadowed($$PWD)
# Check if ccache is enabled
ccache {
QMAKE_CXX = ccache g++
}
debian {
QMAKE_CPPFLAGS *= $(shell dpkg-buildflags --get CPPFLAGS)
QMAKE_CFLAGS *= $(shell dpkg-buildflags --get CFLAGS)
QMAKE_CXXFLAGS *= $(shell dpkg-buildflags --get CXXFLAGS)
QMAKE_LFLAGS *= $(shell dpkg-buildflags --get LDFLAGS)
}
# Check for Bluetoot LE support (Qt >= 5.4)
equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 3) {
DEFINES += BLUETOOTH_LE
}
# Enable coverage option
coverage {
# Note: this works only if you build in the source dir
OBJECTS_DIR =
MOC_DIR =
LIBS += -lgcov
QMAKE_CXXFLAGS += --coverage
QMAKE_LDFLAGS += --coverage
QMAKE_EXTRA_TARGETS += coverage cov
QMAKE_EXTRA_TARGETS += clean-gcno clean-gcda coverage-html \
generate-coverage-html clean-coverage-html coverage-gcovr \
generate-gcovr generate-coverage-gcovr clean-coverage-gcovr
clean-gcno.commands = \
"@echo Removing old coverage instrumentation"; \
"find -name '*.gcno' -print | xargs -r rm"
clean-gcda.commands = \
"@echo Removing old coverage results"; \
"find -name '*.gcda' -print | xargs -r rm"
coverage-html.depends = clean-gcda check generate-coverage-html
generate-coverage-html.commands = \
"@echo Collecting coverage data"; \
"lcov --directory $${top_srcdir} --capture --output-file coverage.info --no-checksum --compat-libtool"; \
"lcov --extract coverage.info \"*/server/*.cpp\" --extract coverage.info \"*/libguh-core/*.cpp\" --extract coverage.info \"*/libguh/*.cpp\" -o coverage.info"; \
"lcov --remove coverage.info \"moc_*.cpp\" --remove coverage.info \"*/test/*\" -o coverage.info"; \
"LANG=C genhtml --prefix $${top_srcdir} --output-directory coverage-html --title \"guh coverage\" --legend --show-details coverage.info"
clean-coverage-html.depends = clean-gcda
clean-coverage-html.commands = \
"lcov --directory $${top_srcdir} -z"; \
"rm -rf coverage.info coverage-html"
coverage-gcovr.depends = clean-gcda check generate-coverage-gcovr
generate-coverage-gcovr.commands = \
"@echo Generating coverage GCOVR report"; \
"gcovr -x -r $${top_srcdir} -o $${top_srcdir}/coverage.xml -e \".*/moc_.*\" -e \"tests/.*\" -e \".*\\.h\""
clean-coverage-gcovr.depends = clean-gcda
clean-coverage-gcovr.commands = \
"rm -rf $${top_srcdir}/coverage.xml"
QMAKE_CLEAN += *.gcda *.gcno coverage.info coverage.xml
}
# Enable Radio 433 MHz for GPIO's
enable433gpio {
DEFINES += GPIO433
}