I'm getting crazy trying to make it work the way I think it should. I must be misunderstanding something.
I would like to have qmake generate makefiles that produce the output (TARGET) in specific directories for debug and release. I've tried something on the lines of what you (and many others) suggest, but it simply doesn't work for me.
I have:
@TEMPLATE = lib
CONFIG = qt shared debug_and_release build_all
debug_and_release:build_pass {
CONFIG(debug, debug|release) {
TARGET = ColorAnalyzerSimulator_debug
DESTDIR = debug
} else {
TARGET = ColorAnalyzerSimulator_release
DESTDIR = release
}
}
DEPENDPATH += .
INCLUDEPATH += .
Input
HEADERS += ColorAnalyzerSimulator.h
SOURCES += ColorAnalyzerSimulator.cpp@
And I issue the command
@qmake -spec macx-g++ -o Makefile.mac Simulator.pro@
and when I look into the Makefile.mac.Debug, TARGET has the default name (Simulator) and DESTDIR is empty!!
I have tried many variations of these settings but no result. I've also tried a similar thing on Linux and still no result.
I really hope someone can help.
[quote author="GordonSchumacher" date="1292262276"]Honestly, you really don't want OBJECTS_DIR to be the same between the builds either! (What happens if you inadvertently get a mixture of debug and release object files...?)
What I've done in the past is something like:
@debug_and_release:build_pass {
CONFIG(debug, debug|release) {
CURBUILD = debug
} else {
CURBUILD = release
}
DESTDIR = $${OUT_PWD}/$${CURBUILD}
OBJECTS_DIR = $${OUT_PWD}/$${CURBUILD}/$$dirname($${_PRO_FILE_PWD_})
MOC_DIR = $${OBJECTS_DIR}
UI_DIR = $${OBJECTS_DIR}
RCC_DIR = $${OBJECTS_DIR}
INCLUDEPATH += $${OBJECTS_DIR}
LIBS += -L$${DESTDIR}
unset(CURBUILD)
}@
I'm not positive those are all actually necessary, but you get the idea anyway.[/quote]