在Qt工程文件内设置根据debug/release以及32/64位分别输出到不同目录:(WINDOWS平台)
pro文件:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += debug_and_release
CONFIG(debug, debug|release){
contains(DEFINES, WIN64) {
TARGET = ../../_debug64/AppName
} else {
TARGET = ../../_debug32/AppName
}
} else {
contains(DEFINES, WIN64) {
TARGET = ../../_release64/AppName
} else {
TARGET = ../../_release32/AppName
}
}
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += \
mainwindow.h
FORMS += \
mainwindow.ui
其中核心代码: