summaryrefslogtreecommitdiffstats
path: root/application-manager.pro
blob: 7fd99d16153ca0394905445a66aee68f6ef18123 (plain)
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
requires(linux|android|macos|ios|win32:!winrt)
!versionAtLeast(QT_VERSION, 5.11.2) {
    log("$$escape_expand(\\n\\n) *** The QtApplicationManager module needs to be built against Qt 5.11.2+ ***$$escape_expand(\\n\\n)")
    CONFIG += Qt_version_needs_to_be_at_least_5_11_2
}
requires(!Qt_version_needs_to_be_at_least_5_11_2)

!tools-only:!qtHaveModule(qml):error("The QtQml library is required for a non 'tools-only' build")

TEMPLATE = subdirs
CONFIG += ordered

SUBDIRS += qmake-features
SUBDIRS += benchmarks

enable-tests:QT_BUILD_PARTS *= tests
else:contains(QT_BUILD_PARTS, "tests"):CONFIG += enable-tests
enable-examples:QT_BUILD_PARTS *= examples
else:contains(QT_BUILD_PARTS, "examples"):CONFIG += enable-examples

!ios { # QtCreator won't load the pro file correctly otherwise
    load(configure)
    qtCompileTest(libarchive)
    qtCompileTest(libyaml)
    !headless:qtHaveModule(gui):qtCompileTest(touchemulation)
}

qtHaveModule(waylandcompositor):qtHaveModule(quick):qtConfig(opengl):CONFIG += am_compatible_compositor

load(am-config)

force-single-process:force-multi-process:error("You cannot both specify force-single-process and force-multi-process")
force-multi-process:!headless:!am_compatible_compositor:error("You forced multi-process mode, but the QtCompositor module is not available")

if(linux|force-libcrypto) {
    !if(contains(QT_CONFIG,"openssl")|contains(QT_CONFIG,"openssl-linked")|contains(QT_CONFIG,"ssl")):error("Qt was built without OpenSSL support.")
}

!config_libyaml|no-system-libyaml {
    force-system-libyaml:error("Could not find a system installation for libyaml.")
    else:SUBDIRS += 3rdparty/libyaml/libyaml.pro
}
!config_libarchive|no-system-libarchive {
    force-system-libarchive:error("Could not find a system installation for libarchive.")
    else:SUBDIRS += 3rdparty/libarchive/libarchive.pro
}

linux:!android:!disable-libbacktrace:if(enable-libbacktrace|CONFIG(debug, debug|release))  {
    check_libbacktrace = "yes"
    SUBDIRS += 3rdparty/libbacktrace/libbacktrace.pro
} else {
    check_libbacktrace = "no"
}

!tools-only: SUBDIRS += doc

load(qt_parts)

android|tools-only {
    # removing them from QT_BUILD_PARTS doesn't help
    SUBDIRS -= sub_tests
    SUBDIRS -= sub_examples
}

if(linux|force-libcrypto):check_crypto = "libcrypto / OpenSSL"
else:win32:check_crypto = "WinCrypt"
else:if(macos|ios):check_crypto = "SecurityFramework"

auto-multi-process { check_multi = "yes (auto detect)" } else { check_multi = "no (auto detect)" }
force-single-process { check_multi = "no (force-single-process)" }
force-multi-process  { check_multi = "yes (force-multi-process)" }

CONFIG(debug, debug|release) { check_debug = "debug" } else { check_debug = "release" }

!isEmpty(AM_HARDWARE_ID_FF):check_hwid = "(from file) $$AM_HARDWARE_ID_FF"
else:!isEmpty(AM_HARDWARE_ID):check_hwid = "$$AM_HARDWARE_ID"
else:check_hwid = "auto (derived from network MAC address)"

load(config-output)

printConfigLine()
printConfigLine("-- Application Manager configuration", , orange)
printConfigLine("Version", "$$MODULE_VERSION", white)
printConfigLine("Hardware Id", $$check_hwid, auto)
printConfigLine("Qt version", $$[QT_VERSION], white)
printConfigLine("Qt installation", $$[QT_HOST_BINS])
printConfigLine("Debug or release", $$check_debug, white)
printConfigLine("Installation prefix", $$INSTALL_PREFIX, auto)
printConfigLine("Tools only build", $$yesNo(CONFIG(tools-only)), auto)
printConfigLine("Enable support for QtWidgets", $$yesNo(CONFIG(enable-widgets)), auto)
printConfigLine("Headless", $$yesNo(CONFIG(headless)), auto)
printConfigLine("Touch emulation", $$yesNo(CONFIG(config_touchemulation)), auto)
printConfigLine("QtCompositor support", $$yesNo(CONFIG(am_compatible_compositor)), auto)
printConfigLine("Multi-process mode", $$check_multi, auto)
printConfigLine("Installer enabled", $$yesNo(!CONFIG(disable-installer)), auto)
printConfigLine("Ext. DBus interfaces enabled", $$yesNo(!CONFIG(disable-external-dbus-interfaces)), auto)
printConfigLine("Tests enabled", $$yesNo(CONFIG(enable-tests)), auto)
printConfigLine("Examples enabled", $$yesNo(CONFIG(enable-examples)), auto)
printConfigLine("Crypto backend", $$check_crypto, auto)
printConfigLine("SSDP support", $$yesNo(qtHaveModule(pssdp)), auto)
printConfigLine("Shellserver support", $$yesNo(qtHaveModule(pshellserver)), auto)
printConfigLine("Genivi support", $$yesNo(qtHaveModule(geniviextras)), auto)
printConfigLine("libbacktrace support", $$check_libbacktrace, auto)
printConfigLine("Systemd workaround", $$yesNo(CONFIG(systemd-workaround)), auto)
printConfigLine("System libarchive", $$yesNo(config_libarchive:!no-system-libarchive), auto)
printConfigLine("System libyaml", $$yesNo(config_libyaml:!no-system-libyaml), auto)
printConfigLine()

OTHER_FILES += \
    INSTALL.md \
    .qmake.conf \
    application-manager.conf \
    template-opt/am/*.yaml \
    sync.profile \
    header.*[^~] \
    LICENSE.*[^~] \
    config.tests/libarchive/* \
    config.tests/libyaml/* \
    config.tests/touchemulation/* \
    util/bash/appman-prompt \
    util/bash/README \

GCOV_EXCLUDE = /usr/* \
               $$[QT_INSTALL_PREFIX]/* \
               $$[QT_INSTALL_PREFIX/src]/* \
               $$_PRO_FILE_PWD_/tests/* \
               moc_* \
               $$_PRO_FILE_PWD_/examples/* \
               $$OUT_PWD/* \


!prefix_build: GCOV_EXCLUDE += $$clean_path($$[QT_INSTALL_PREFIX]/../*) $$clean_path($$[QT_INSTALL_PREFIX/src]/../*)

for (f, GCOV_EXCLUDE) {
    GCOV_EXCLUDE_STR += $$shell_quote($$f)
}

global-check-coverage.target = check-coverage
global-check-coverage.depends = coverage
global-check-coverage.commands = ( \
    find . -name \"*.gcov-info\" -print0 | xargs -0 rm -f && \
    lcov -c -i -d . --rc lcov_branch_coverage=1 --rc geninfo_auto_base=1 -o $$OUT_PWD/base.gcov-info && \
    cd tests && make check && cd .. && \
    lcov -c -d . --rc lcov_branch_coverage=1 --rc geninfo_auto_base=1 -o $$OUT_PWD/test.gcov-info && \
    lcov --rc lcov_branch_coverage=1 -o $$OUT_PWD/temp.gcov-info `find . -name \"*.gcov-info\" | xargs -n1 echo -a` && \
    lcov --rc lcov_branch_coverage=1 -o $$OUT_PWD/application-manager.gcov-info -r temp.gcov-info $$GCOV_EXCLUDE_STR && \
    rm -f base.gcov-info test.gcov-info temp.gcov-info && \
    genhtml -o branch-coverage -s -f --legend --branch-coverage --rc lcov_branch_coverage=1 --demangle-cpp application-manager.gcov-info && \
    echo \"\\n\\nCoverage info is available at file://`pwd`/branch-coverage/index.html\" \
)

QMAKE_EXTRA_TARGETS -= sub-check-coverage
QMAKE_EXTRA_TARGETS *= global-check-coverage