-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.pri
241 lines (196 loc) · 6.07 KB
/
config.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
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
MALIIT_VERSION = $$system(cat $$PWD/VERSION)
MALIIT_INTERFACE_VERSION = 1.0
MALIIT_PLUGINS_INTERFACE_VERSION = 1.0
MALIIT_PLUGINS_QUICK_INTERFACE_VERSION = 0.80
MALIIT_FRAMEWORK_INTERFACE_VERSION = 0.80
MALIIT_CONNECTION_INTERFACE_VERSION = 0.80
MALIIT_SERVER_INTERFACE_VERSION = 0.80
MALIIT_ABI_VERSION = $$MALIIT_VERSION
# For libmaliit
MALIIT_LIB = maliit-1.0
MALIIT_SETTINGS_LIB = maliit-settings
MALIIT_HEADER = maliit-qt4
MALIIT_FRAMEWORK_HEADER = maliit-qt4/framework
# For libmaliit-glib
MALIIT_CONNECTION_GLIB_LIB = maliit-connection-glib
MALIIT_GLIB_LIB = maliit-glib
include(defines.pri)
# Linker optimization for release build
QMAKE_LFLAGS_RELEASE+=-Wl,--as-needed
# Compiler warnings are error if the build type is debug
QMAKE_CXXFLAGS_DEBUG+=-Werror -O0
QMAKE_CFLAGS_DEBUG+=-Werror -O0
OBJECTS_DIR = .obj
MOC_DIR = .moc
isEmpty(MALIIT_VERSION) {
MALIIT_VERSION=$$MALIIT_VERSION
}
isEmpty(PREFIX) {
PREFIX = /usr
}
isEmpty(BINDIR) {
BINDIR = $$PREFIX/bin
}
isEmpty(LIBDIR) {
LIBDIR = $$PREFIX/lib
}
isEmpty(INCLUDEDIR) {
INCLUDEDIR = $$PREFIX/include
}
DATADIR = $$PREFIX/share
isEmpty(DOCDIR) {
DOCDIR = $$DATADIR/doc
}
isEmpty(MALIIT_PLUGINS_DIR) {
MALIIT_PLUGINS_DIR = $$LIBDIR/$$MALIIT_PLUGINS
}
DEFINES += MALIIT_PLUGINS_DIR=\\\"$$MALIIT_PLUGINS_DIR\\\"
isEmpty(MALIIT_PLUGINS_DATA_DIR) {
MALIIT_PLUGINS_DATA_DIR = $$DATADIR/$$MALIIT_PLUGINS_DATA
}
DEFINES += MALIIT_PLUGINS_DATA_DIR=\\\"$$MALIIT_PLUGINS_DATA_DIR\\\"
isEmpty(MALIIT_FACTORY_PLUGINS_DIR) {
MALIIT_FACTORY_PLUGINS_DIR = $$MALIIT_PLUGINS_DIR/factories
}
DEFINES += MALIIT_FACTORY_PLUGINS_DIR=\\\"$$MALIIT_FACTORY_PLUGINS_DIR\\\"
isEmpty(MALIIT_ENABLE_MULTITOUCH) {
MALIIT_ENABLE_MULTITOUCH=true
}
MALIIT_EXTENSIONS_DIR = $$DATADIR/$$MALIIT_ATTRIBUTE_EXTENSIONS/
DEFINES += MALIIT_EXTENSIONS_DIR=\\\"$$MALIIT_EXTENSIONS_DIR\\\"
isEmpty(MALIIT_DEFAULT_HW_PLUGIN) {
MALIIT_DEFAULT_HW_PLUGIN = libmaliit-keyboard-plugin.so
}
isEmpty(MALIIT_DEFAULT_PLUGIN) {
MALIIT_DEFAULT_PLUGIN = libmaliit-keyboard-plugin.so
}
MALIIT_TEST_DATADIR = $$DATADIR/$$MALIIT_TEST_SUITE
MALIIT_TEST_LIBDIR = $$LIBDIR/$$MALIIT_TEST_SUITE
MALIIT_TEST_TMPDIR = /tmp/$$MALIIT_TEST_SUITE
MALIIT_TEST_PLUGINS_DIR = $$MALIIT_TEST_LIBDIR/plugins
DEFINES += MALIIT_TEST_PLUGINS_DIR=\\\"$$MALIIT_TEST_PLUGINS_DIR\\\"
DEFINES += MALIIT_CONFIG_ROOT=\\\"$$MALIIT_CONFIG_ROOT\\\"
DEFINES += MALIIT_FRAMEWORK_USE_INTERNAL_API
# Do not define keywords signals, slots, emit and foreach because of
# conflicts with 3rd party libraries.
CONFIG += no_keywords
unix {
MALIIT_STATIC_PREFIX=lib
MALIIT_STATIC_SUFFIX=.a
MALIIT_DYNAMIC_PREFIX=lib
MALIIT_DYNAMIC_SUFFIX=.so
MALIIT_ABI_VERSION_MAJOR=
}
win32 {
# qmake puts libraries in subfolders in build tree on Windows (installation is unaffected)
release {
MALIIT_STATIC_PREFIX=release/lib
MALIIT_DYNAMIC_PREFIX=release/
}
debug {
MALIIT_STATIC_PREFIX=debug/lib
MALIIT_DYNAMIC_PREFIX=debug/
}
# one would suspect this to be .lib, but qmake with mingw uses .a
MALIIT_STATIC_SUFFIX=.a
# qmake adds the first component of the version as part of the DLL name on Windows
MALIIT_ABI_VERSIONS=$$split(MALIIT_ABI_VERSION, ".")
MALIIT_ABI_VERSION_MAJOR=$$member(MALIIT_ABI_VERSIONS, 0)
MALIIT_DYNAMIC_SUFFIX=$${MALIIT_ABI_VERSION_MAJOR}.dll
}
defineReplace(maliitStaticLib) {
return($${MALIIT_STATIC_PREFIX}$${1}$${MALIIT_STATIC_SUFFIX})
}
defineReplace(maliitDynamicLib) {
return($${MALIIT_DYNAMIC_PREFIX}$${1}$${MALIIT_DYNAMIC_SUFFIX})
}
mac {
# Do mac stuff here
M_BUILD_FEATURES = debug
M_PROFILE_PARTS =
INCLUDEPATH += include/
}
contains(QT_CONFIG,embedded) {
CONFIG += qws
}
# Use x11 on unix systems without lighthouse (qpa) or QWS (qws)
unix:!qpa:!qws {
CONFIG += x11
}
contains(QT_MAJOR_VERSION, 4) {
QT_WIDGETS = gui
} else {
QT_WIDGETS = gui widgets
wayland {
DEFINES += HAVE_WAYLAND
}
}
MALIIT_INSTALL_PRF = $$[QT_INSTALL_DATA]/mkspecs/features
local-install {
MALIIT_INSTALL_PRF = $$replace(MALIIT_INSTALL_PRF, $$[QT_INSTALL_PREFIX], $$PREFIX)
}
defineTest(outputFile) {
out = $$OUT_PWD/$$1
in = $$PWD/$${1}.in
!exists($$in) {
error($$in does not exist!)
return(false)
}
MALIIT_IN_DIR = $$PWD
MALIIT_OUT_DIR = $$OUT_PWD
variables = MALIIT_FRAMEWORK_FEATURE \
PREFIX \
BINDIR \
INCLUDEDIR \
LIBDIR \
DOCDIR \
MALIIT_PLUGINS_DIR \
MALIIT_PLUGINS_DATA_DIR \
MALIIT_FACTORY_PLUGINS_DIR \
MALIIT_VERSION \
MALIIT_ENABLE_MULTITOUCH \
MALIIT_DEFAULT_HW_PLUGIN \
MALIIT_DEFAULT_PLUGIN \
MALIIT_QUICK_FEATURE \
MALIIT_PLUGINS_LIB \
MALIIT_PLUGINS_HEADER \
MALIIT_LIB \
MALIIT_HEADER \
MALIIT_PLUGINS_QUICK_LIB \
MALIIT_PLUGINS_QUICK_HEADER \
MALIIT_PLUGINS_QUICK_FACTORY \
MALIIT_SETTINGS_LIB \
MALIIT_TEST_SUITE \
MALIIT_TEST_DATADIR \
MALIIT_TEST_LIBDIR \
MALIIT_TEST_TMPDIR \
MALIIT_IN_DIR \
MALIIT_OUT_DIR \
MALIIT_PACKAGENAME \
MALIIT_PACKAGE_BRIEF \
MALIIT_FRAMEWORK_HEADER \
MALIIT_SERVER_ARGUMENTS \
MALIIT_CONNECTION_HEADER \
MALIIT_CONNECTION_LIB \
MALIIT_SERVER_HEADER \
MALIIT_ABI_VERSION_MAJOR \
MALIIT_GLIB_LIB \
command = "sed"
for(var, variables) {
command += "-e \"s;@$$var@;$$eval($$var);g\""
}
command += $$in > $$out
system(mkdir -p $$dirname(out))
system($$command)
system(chmod --reference=$$in $$out)
QMAKE_DISTCLEAN += $$1
export(QMAKE_DISTCLEAN)
return(true)
}
defineTest(outputFiles) {
files = $$ARGS
for(file, files) {
!outputFile($$file):return(false)
}
return(true)
}