1 | isEmpty(DEPTH):error("DEPTH must be set before including common.pri \
|
---|
2 | so that it leads to test's root dir.")
|
---|
3 |
|
---|
4 | # on Unix exes have no extension so we need to put them to a subdir
|
---|
5 | # to avoid clashes with the possible subtest's directories
|
---|
6 | unix:DESTDIR = $$DEPTH/.bin
|
---|
7 | else:DESTDIR = $$DEPTH
|
---|
8 |
|
---|
9 | !build_pass: {
|
---|
10 | debug_and_release {
|
---|
11 | debug-run.target = debug-run
|
---|
12 | debug-run.commands = $(MAKE) -f $(MAKEFILE).Debug run
|
---|
13 | release-run.target = release-run
|
---|
14 | release-run.commands = $(MAKE) -f $(MAKEFILE).Release run
|
---|
15 | QMAKE_EXTRA_TARGETS += debug-run release-run
|
---|
16 |
|
---|
17 | debug-dbg.target = debug-dbg
|
---|
18 | debug-dbg.commands = $(MAKE) -f $(MAKEFILE).Debug dbg
|
---|
19 | release-dbg.target = release-dbg
|
---|
20 | release-dbg.commands = $(MAKE) -f $(MAKEFILE).Release dbg
|
---|
21 | QMAKE_EXTRA_TARGETS += debug-dbg release-dbg
|
---|
22 | }
|
---|
23 | } else {
|
---|
24 | isEmpty(RUN_SHELL):RUN_SHELL = $(RUN_SHELL)
|
---|
25 | isEmpty(RUN_ARGS):RUN_ARGS = $(RUN_ARGS)
|
---|
26 |
|
---|
27 | run.target = run
|
---|
28 | run.commands = $$RUN_SHELL $(DESTDIR_TARGET) $$RUN_ARGS
|
---|
29 | run.depends = $(DESTDIR_TARGET)
|
---|
30 | QMAKE_EXTRA_TARGETS += run
|
---|
31 |
|
---|
32 | os2:isEmpty(RUN_DEBUG):RUN_DEBUG = idbug
|
---|
33 | win:isEmpty(RUN_DEBUG):RUN_DEBUG = windbg
|
---|
34 | unix:isEmpty(RUN_DEBUG):RUN_DEBUG = gdb
|
---|
35 |
|
---|
36 | dbg.target = dbg
|
---|
37 | dbg.commands = $$RUN_SHELL $$RUN_DEBUG $(DESTDIR_TARGET) $$RUN_ARGS
|
---|
38 | dbg.depends = $(DESTDIR_TARGET)
|
---|
39 | QMAKE_EXTRA_TARGETS += dbg
|
---|
40 | }
|
---|
41 |
|
---|
42 | # All kinds of builds should have the console if possible
|
---|
43 | win32 {
|
---|
44 | CONFIG(release, debug|release):CONFIG(qt):contains(QT, gui) {
|
---|
45 | CONFIG -= console
|
---|
46 | CONFIG *= windows
|
---|
47 | } else {
|
---|
48 | CONFIG -= windows
|
---|
49 | CONFIG *= console
|
---|
50 | }
|
---|
51 | }
|
---|
52 | os2 {
|
---|
53 | CONFIG -= windows
|
---|
54 | CONFIG *= console
|
---|
55 | }
|
---|
56 |
|
---|
57 | defineReplace(fixSep) {
|
---|
58 | win32|os2 {
|
---|
59 | 1 = $$replace(1,/,\\)
|
---|
60 | }
|
---|
61 | return($$1)
|
---|
62 | }
|
---|
63 |
|
---|
64 | defineReplace(file_copier_output_path) {
|
---|
65 | isEmpty(FILES.path):FILES.path = $$DESTDIR
|
---|
66 | 1 = $${FILES.path}/$$basename(1)
|
---|
67 | return($$1)
|
---|
68 | }
|
---|
69 |
|
---|
70 | file_copier.input = FILES
|
---|
71 | file_copier.output = ${QMAKE_FUNC_file_copier_output_path}
|
---|
72 | file_copier.commands = $(COPY_FILE) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
---|
73 | file_copier.CONFIG += no_link
|
---|
74 | file_copier.variable_out = POST_TARGETDEPS
|
---|
75 | QMAKE_EXTRA_COMPILERS += file_copier
|
---|