pro文件内设置根据debug/release以及32/64位分别输出到不同目录:
1 QT += core gui
2
3 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
4
5 CONFIG += debug_and_release
6 CONFIG(debug, debug|release){
7 contains(DEFINES, WIN64) {
8 TARGET = ../../_debug64/AppName
9 } else {
10 TARGET = ../../_debug32/AppName
11 }
12 } else {
13 contains(DEFINES, WIN64) {
14 TARGET = ../../_release64/AppName
15 } else {
16 TARGET = ../../_release32/AppName
17 }
18 }
19
20 TEMPLATE = app
21 DEFINES += QT_DEPRECATED_WARNINGS
22
23 SOURCES += \
24 main.cpp \
25 mainwindow.cpp
26
27 HEADERS += \
28 mainwindow.h
29
30 FORMS += \
31 mainwindow.ui
其中核心代码: