-
Notifications
You must be signed in to change notification settings - Fork 3
/
common.pri
40 lines (34 loc) · 1.15 KB
/
common.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
isEmpty(COMMON_PRI_INCLUDED) {
COMMON_PRI_INCLUDED = 1
# Creates Makefile target to substitute all occurencies of @VARIABLE@ in the given file.
# To substitute a VARIABLE, add it to the CONFIG_SUBST list.
defineTest(configure) {
in_file = $$1
target_file = $$basename(in_file)
target_file ~= s/\\.in$//
target = configure_$${target_file}
target ~= s/[^a-zA-Z0-9]/_/g
eval($${target}.target = $${target_file})
eval($${target}.depends = $${in_file} $(MAKEFILE_LIST))
eval($${target}.commands = sed)
for(v, CONFIG_SUBST) {
eval($${target}.commands += '-e \\\"s!@$${v}@!\$${$${v}}!g\\\"')
}
eval($${target}.commands += '<$${in_file} >$${target_file} || { rm -f $${target_file}; exit 1; }')
QMAKE_EXTRA_TARGETS += $${target}
equals(TEMPLATE, subdirs) {
first = make_first
} else {
first = all
}
eval($${first}.depends += $${target})
eval($${first}.CONFIG = phony)
QMAKE_EXTRA_TARGETS += $${first}
export($${target}.target)
export($${target}.depends)
export($${target}.commands)
export($${first}.depends)
export($${first}.CONFIG)
export(QMAKE_EXTRA_TARGETS)
}
}