PDA

View Full Version : qmake bug?



William Wilson
1st January 2008, 03:28
Qt version: Qt 4.3.0
OS: Linux

I'm trying to separate binaries for debug and release builds. On Linux, qmake does not generate scripts for making debug versions (g++ -g). On Win32 platforms, this works perfectly fine. Am I missing something or is it a qmake bug? Thanks in advance for any workarounds.
-------------------------------------------------------------

qmake usage:
qmake -makefile test.pro "CONFIG+=build_all"

make

------------------------------------------------------------
test.pro file:


TEMPLATE = lib
TARGET = test
CONFIG(debug, debug|release)
{
DESTDIR = ../../bin/debug/plugins
OBJECTS_DIR = ../../bin/debug/obj
MOC_DIR = ../../bin/debug/moc
} else
{
DESTDIR = ../../bin/release/plugins
OBJECTS_DIR = ../../bin/release/obj
MOC_DIR = ../../bin/release/moc
}
----------------------------------------------------

DeepDiver
1st January 2008, 10:43
You need to add:CONFIG += debug_and_release

William Wilson
1st January 2008, 17:44
Unfortunately, even that doesn't work on Linux. All i want is to generate separate binaries for "debug" so that i can step through using gdb and "release" binaries for distributing - from the same .pro file. You guys may already have a solution for this kind of build. Can someone please help?

DeepDiver
1st January 2008, 18:04
Hi William,

my posted solution DOES work on linux - thats the way I use it.
In order to be sure that qmake really re-generates the Makefiles:
-make clean
-delete all make files
-invoke qmake again

Good luck,

Tom

William Wilson
1st January 2008, 20:19
Tom,
Can you post your relevant .pro file code? May be there is a difference in the way that i'm using it. What is your Qt version? Thanks again.

DeepDiver
1st January 2008, 21:05
here we go ...


Good luck,

Tom

William Wilson
1st January 2008, 23:05
Thanks Tom.
It works fine with your example:


CONFIG(debug, debug|release) {
win32: TARGET = $$join(TARGET,,d)
TARGET = $$join(TARGET,,,_debug)
}

And not with this:


CONFIG(debug, debug|release)
{
DESTDIR = ../../bin/debug/plugins
OBJECTS_DIR = ../../bin/debug/obj
MOC_DIR = ../../bin/debug/moc
} else {
DESTDIR = ../../bin/release/plugins
OBJECTS_DIR = ../../bin/release/obj
MOC_DIR = ../../bin/release/moc
}

:-(

jpn
2nd January 2008, 07:41
qmake is a bit picky when it comes to scopes (http://doc.trolltech.com/latest/qmake-advanced-usage.html#scopes). It should be


CONFIG(debug, debug|release) {
...
} else {
...
}

William Wilson
4th January 2008, 01:30
That worked. Thank you jpn!