1
# helpers to reduce the size of unittest projects
5
CONFIG += qtestlib console debug qt
10
# otherwise we would get 'unresolved external _WinMainCRTStartup'
11
# when compiling with MSVC
25
EXEC_TARGET = $${TARGET}.app/Contents/MacOS/$${TARGET}
28
EXEC_TARGET = $$TARGET
31
# check target (TODO: Make it work on Windows too)
32
QMAKE_EXTRA_TARGETS += check
33
check.depends = $$EXEC_TARGET
34
check.commands = ./$$EXEC_TARGET
37
# valgrind target (only shows valgrind output)
38
VALGRIND_OPTIONS = -q --num-callers=40 --leak-check=full --show-reachable=yes --suppressions=$$PWD/valgrind.supp
39
QMAKE_EXTRA_TARGETS += valgrind
40
valgrind.depends = $$EXEC_TARGET
41
valgrind.commands = valgrind $$VALGRIND_OPTIONS ./$$EXEC_TARGET | grep -E '==\d+=='
43
# valgrind_supp target (generate suppressions)
44
QMAKE_EXTRA_TARGETS += valgrind_supp
45
valgrind_supp.depends = $$EXEC_TARGET
46
valgrind_supp.commands = valgrind $$VALGRIND_OPTIONS --gen-suppressions=all ./$$EXEC_TARGET
49
QMAKE_EXTRA_TARGETS += callgrind
50
callgrind.depends = $$EXEC_TARGET
51
callgrind.commands = valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes ./$$EXEC_TARGET
54
QMAKE_EXTRA_TARGETS += gdb
55
gdb.depends = $$EXEC_TARGET
57
QT_FRAMEWORK_VERSION = 4
58
QT_FRAMEWORKS = QtCore QtXml QtNetwork QtGui QtSql Qt3Support
59
FRAMEWORK = \$(QTDIR)/lib/\$\${f}.framework/Versions/$$QT_FRAMEWORK_VERSION/\$\${f}
61
for f in $$QT_FRAMEWORKS; do \
62
install_name_tool -id "$$FRAMEWORK" "$$FRAMEWORK""_debug"; \
63
install_name_tool -change "$$FRAMEWORK" "$$FRAMEWORK""_debug" "./$$EXEC_TARGET"; \
66
gdb.commands += gdb ./$$EXEC_TARGET
69
for f in $$QT_FRAMEWORKS; do \
70
install_name_tool -id "$$FRAMEWORK""_debug" "$$FRAMEWORK""_debug"; \
71
install_name_tool -change "$$FRAMEWORK""_debug" "$$FRAMEWORK" "./$$EXEC_TARGET"; \
78
QMAKE_EXTRA_TARGETS += xcode
79
xcode.depends = Makefile
80
xcode.commands = ${QMAKE} -spec macx-xcode -o $$TARGET
b'\\ No newline at end of file'