PDA

View Full Version : qmake and debug output



mattie
7th March 2006, 22:03
hi

I've put the following in my qmake project file:

release {
DEFINES += QT_NO_DEBUG_OUTPUT
}
My goal is to disable debug output in the release build. However, when I specify it like above, debug output is also disabled in the debug build. What am I doing wrong?

tia
matthias

wysota
7th March 2006, 23:06
Hmm... but debug output is disabled in release build... Could you show your complete project file?

mattie
7th March 2006, 23:36
if I don't explicitly define it, I see the -DQT_NO_DEBUG directive, but not the QT_NO_DEBUG_OUTPUT one. problem with the explicit definition is that it also applies for debug build then (though I tried to make it conditional).

I'm using Qt 4.1.0 open source edition with mingw32

oob2
8th March 2006, 00:11
on top of your project file, try add these lines:

CONFIG -= release
CONFIG += debug

.....

mattie
17th September 2006, 23:10
okay, this helps... but this would mean I need 2 project files, one for release and one for debug, right? defeats a bit the existance of conditional statements imo..? ;)

I have recently upgraded from qt 4.1.0 to 4.1.4 and still have the same problem, weird..
I'm on windows

wysota
17th September 2006, 23:20
okay, this helps... but this would mean I need 2 project files, one for release and one for debug, right?

Wrong. You can always pass "CONFIG+=debug" (or other) as a commandline parameter to qmake, you don't need to change the project file.

fullmetalcoder
18th September 2006, 07:18
Wrong. You can always pass "CONFIG+=debug" (or other) as a commandline parameter to qmake, you don't need to change the project file.
Wrong way...

use qmake's "-config" switch instead if you really want to do it that way...

If you want to use debug_and_release then here is the way to go :


CONFIG(debug, debug|release) {
#debug specific code here
} else {
#release specific code here
}


And everything will be allright... :)

mattie
18th September 2006, 22:33
thanks, this did the trick
though I still have the feeling this is probably default behavior in a standard install, so it makes me wonder whether something is wrong with my qt install. But anyhow, it's really a joy now to make release AND debug builds with proper output =)