[Qt-interest] problem with scopes in qmake makefiles
John McClurkin
jwm at nei.nih.gov
Tue Feb 9 02:17:46 CET 2010
Elric wrote:
> I have the following code in makefile:
>
> win32 {
> CONFIG(debug) {
> DESTDIR = bin/debug
> OBJECTS_DIR = bin/debug
> CONFIG += console
> } else {
> DESTDIR = bin/release
> OBJECTS_DIR = bin/release
> CONFIG -= console
> QMAKE_POST_LINK = upx -9 -q $$DESTDIR/$$join(TARGET, "", "", ".exe")
> }
> }
>
> The problem is that when I build it in release mode, it is built as a
> console application and the resulting executable doesn't get
> compressed with upx. It just looks like a debug rule has been applied.
> However, the executable is built in bin/release folder, which means
> that qmake took DESTDIR and OBJECTS_DIR from release rule, and CONSOLE
> from debug one.
>
> I'm using the following commands to compile it:
>
> qmake
> nmake release
>
> and
>
> qmake
> nmake debug
>
> Am I missing something?
>
The way I do this is:
CONFIG(release, debug|release) {
.
.
.
}
CONFIG(debug, debug|relase) {
.
.
.
}
I don't remember just where I stumbled on this format, but it works for me.
More information about the Qt-interest-old
mailing list