-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunittest.pri
67 lines (60 loc) · 1.64 KB
/
unittest.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
# ripped from psi/qa/oldtest/unittest.pri
# helpers to reduce the size of unittest projects
unittest {
TEMPLATE = app
CONFIG += qtestlib console debug qt
CONFIG -= app_bundle
}
windows {
# otherwise we would get 'unresolved external _WinMainCRTStartup'
# when compiling with MSVC
MOC_DIR = _moc
OBJECTS_DIR = _obj
UI_DIR = _ui
RCC_DIR = _rcc
}
!windows {
MOC_DIR = .moc
OBJECTS_DIR = .obj
UI_DIR = .ui
RCC_DIR = .rcc
}
mac:app_bundle {
EXEC_TARGET = $${TARGET}.app/Contents/MacOS/$${TARGET}
}
else {
EXEC_TARGET = $$TARGET
}
# run target (TODO: Make it work on Windows too)
QMAKE_EXTRA_TARGETS += run
run.depends = $$EXEC_TARGET
run.commands = AFISHACINEMADATADIR=~/.afisha-cinema-test ./$$EXEC_TARGET
unix {
# gdb target
QMAKE_EXTRA_TARGETS += gdb
gdb.depends = $$EXEC_TARGET
mac {
QT_FRAMEWORK_VERSION = 4
QT_FRAMEWORKS = QtCore QtXml QtNetwork QtGui QtSql Qt3Support
FRAMEWORK = \$(QTDIR)/lib/\$\${f}.framework/Versions/$$QT_FRAMEWORK_VERSION/\$\${f}
gdb.commands += \
for f in $$QT_FRAMEWORKS; do \
install_name_tool -id "$$FRAMEWORK" "$$FRAMEWORK""_debug"; \
install_name_tool -change "$$FRAMEWORK" "$$FRAMEWORK""_debug" "./$$EXEC_TARGET"; \
done;
}
gdb.commands += AFISHACINEMADATADIR=~/.afisha-cinema-test gdb ./$$EXEC_TARGET
mac {
gdb.commands += ; \
for f in $$QT_FRAMEWORKS; do \
install_name_tool -id "$$FRAMEWORK""_debug" "$$FRAMEWORK""_debug"; \
install_name_tool -change "$$FRAMEWORK""_debug" "$$FRAMEWORK" "./$$EXEC_TARGET"; \
done;
}
}
mac {
# xcode target
QMAKE_EXTRA_TARGETS += xcode
xcode.depends = Makefile
xcode.commands = ${QMAKE} -spec macx-xcode -o $$TARGET
}