Not exactly shadow builds as qt-creator defines them but I am using the following to get a neat build structure.
Excerpt from a pro-file for a library that I build for multiple targets and also
in test modes.
TARGET = ../lib/common
message("libcommon:")
contains(CONFIG,test){
message("Building Test")
DESTDIR = test
TARGET = $$TARGET-test
}else{
message("Building Program")
DESTDIR = program
TARGET = $$TARGET
}
contains(MEEGO_EDITION,harmattan){
message("Maemo Harmattan")
DESTDIR = $$DESTDIR-maemo6
TARGET = $$TARGET-maemo6
DEFINES += MAEMO MAEMO6
}
unix:!maemo5:!contains(MEEGO_EDITION,harmattan){#desktop
message("Desktop")
DESTDIR = $$DESTDIR-desktop
TARGET = $$TARGET-desktop
}
contains(CONFIG,test){
TEMPLATE = app
SOURCES += $$files(src_test/main.cpp)
HEADERS += $$files(src_test/*.h)
INCLUDEPATH += src_test
}else{
TEMPLATE = lib
CONFIG += staticlib
}
CONFIG(debug, debug|release) {
message("Debug")
DESTDIR = $$DESTDIR-debug
CONFIG += debug
DEFINES += DEBUG
TARGET = $$TARGET-debug
}else{
message("Release")
//DEFINES += QT_NO_DEBUG_OUTPUT
DESTDIR = $$DESTDIR-release
TARGET = $$TARGET-release
}
MOC_DIR = build/$${DESTDIR}/moc
OBJECTS_DIR = build/$${DESTDIR}/obj
UI_DIR = build/$${DESTDIR}/ui
So you get all your object,moc,gui files in separate directories (e.g libcommon/build/program-desktop-debug/moc) and your binaries in the same with different names. To trigger one build or another you simply set a CONFIG+= in the build target. And the best about it this structure only depends on the pro file and you can put parts of it in a common.pri and use it for all your projects. No need for shadow-build configuration anymore. By the way the pro file resides in libcommon/libcommon.pro as it should.