I'm new to Qt and QtCreator, and, coming from Code::Blocks, I used to separate object files in two folders, each for each target of the project (generally Debug and Release), so that when I switched targets, the object files from the last target I worked on weren't 'flushed'.
I'm starting to notice this is not as common as I expected to be (it makes sense to me), and I am having trouble getting this to work with QMake (or QtCreator? See below). If you think you have a good reason not to do this, please also post here. Maybe I'm missing something.

For example, if I was working in a debug build and wanted to test some feature in release mode, I would switch to the "Release" target and build it. That would keep the up-to-date object files in obj/release and update the ones needing updates. Later I would switch back to "Debug" target and continue working, without having to rebuild anything because that target's object files were kept separately (inside obj/debug).

The problem is, if I do so, when I switch targets and rebuild, make clean will be run before QMake is run over my project file. What it means is that it will "clean" the old target, and then switch and call make. As I use these following lines to configure the OBJECTS_DIR variable, it cleans the objects inside obj/release, for example, then OBJECTS_DIR is changed to obj/debug and then make is called, without a clean objects folder:
Qt Code:
  1. CONFIG (debug,debug|release) {
  2. OBJECTS_DIR = ../obj/debug
  3. TARGET = molise_d
  4. } else {
  5. OBJECTS_DIR = ../obj/release
  6. TARGET = molise
  7. }
To copy to clipboard, switch view to plain text mode 

Is there any way to do what I'm intending to do? I would need some way to make QMake get called before `make clean' does, mmme thinks.. Any ideas?