This is my solution:
* Build and install both debug and release versions of the Qt SDK
That means I have two versions of the SDK installed. My physical directories are:
QtSDK/4.7.3
QtSDK/4.7.3-debug
QtSDK/4.7.3
QtSDK/4.7.3-debug
To copy to clipboard, switch view to plain text mode
* In the QtCreator Tools/Options dialog, on the Qt4 page, 'Manually' add the two directories above.
Remove the 'Qt he PATH' entry
You can also remove Qt from the PATH. QtCreator will add the qmake and tools back
into the path for you.
* From 'Edit build configuration' drop down remove extra entries so you only have the '4.7.3 Release'
and '4.7.3-debug Debug' entries.
* Make sure the 'Qt version' is correct for each build configuration. '4.7.3 Release' should be '4.7.3'
and '4.7.3-debug Debug' should be '4.7.3-debug'. If you need to change this then you probably
deleted the wrong build configuration.
* Edit 'qmake' Build Step to make sure the 'CONFIG' value is set. Expand the details,
if the 'Effective qmake call' does not include a CONFIG value, add it on the
'Additional arguments' line.
for 4.7.3-debug Debug:
CONFIG+=debug
CONFIG+=debug
To copy to clipboard, switch view to plain text mode
for 4.7.3 Release
CONFIG+=release
CONFIG+=release
To copy to clipboard, switch view to plain text mode
* To make two build outputs (debug/release) you need to add the following to your .pro file:
CONFIG(release, debug|release) {
DESTDIR = release
OBJECTS_DIR = release
}else{
DESTDIR = debug
OBJECTS_DIR = debug
}
CONFIG(release, debug|release) {
DESTDIR = release
OBJECTS_DIR = release
}else{
DESTDIR = debug
OBJECTS_DIR = debug
}
To copy to clipboard, switch view to plain text mode
Note that the Makefile will need to be regenerated when switching build configurations, but this
appears to automatically happen.
So what you end up with is a fully debuggable version of your app including the Qt libraries and
a release version of your app with the release libraries, each in there own directory. This makes
it quick to switch back and forth between build configurations.
Bookmarks