PDA

View Full Version : QMake Incorrect Makefile generated



Octal
16th March 2011, 13:15
Hello,

I'm on Windows using the new Beta Qt SDK (Qt 4.7.2), with MinGW.

I tried creating a new GUI Application on creator (with a .ui file).

I modified a little bit the .pro file, putting :



CONFIG -= warn_on warn_off release debug debug_and_release
CONFIG *= qt warn_on release


when compiling, I get :

process_begin: CreateProcess(NULL, c:\Qt\Desktop\Qt\4.7.2\mingw\binuic.exe ..\qmaketest\mainwindow.ui -o ui_mainwindow.h, ...) failed.

As you can see, make is trying to invoke the incorrect uic binary (binuic.exe instead of bin\uic.exe). I fixed this issue by removing debug_and_release from the first line.

However, I can't figure out why qmake is generating an incorrect makefile (the DIR_SEPARAOR seems to be empty). I also tried with Qt 4.7.0, same issue.

It is working fine on Linux & Mac. QMake Windows bug I guess ?

wysota
16th March 2011, 13:44
You could have a look inside the QTDIR/mkspecs directory to see if the separator is set up correctly.

Octal
16th March 2011, 15:07
I already did.

However, it's working when removing debug_and_release from
CONFIG -= ...

That's why I'm wondering if it's a qmake bug or ... (since it's woking on Linux & Mac OS).

wysota
16th March 2011, 18:44
Can we see the whole project file?

Octal
17th March 2011, 11:30
sure, really simple :



QT += core gui

TARGET = qmaketest
TEMPLATE = app

CONFIG -= debug_and_release
CONFIG *= qt warn_on release


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui



just a basic .pro generated by Qt Creator in which I added the two CONFIG lines. Removing or commenting the first CONFIG line makes the application compile. Otherwise, I get :


process_begin: CreateProcess(NULL, c:\Qt\Desktop\Qt\4.7.2\mingw\binuic.exe ..\qmaketest\mainwindow.ui -o ui_mainwindow.h, ...) failed.

where a '\' is missing. I really don't get it :/

wysota
18th March 2011, 06:45
What if you change the relevant two lines to:
CONFIG += release

Octal
19th March 2011, 10:53
It is indeed working, but now if you try :



CONFIG += release

CONFIG(debug, debug|release) {
message("Debug")
} else {
message("Release")
}


You'll get "Release" 3 times.

Anyway, thank you for your help, I think it's a bug on qmake. I'll report it :)

wysota
19th March 2011, 15:05
You'll get "Release" 3 times.
On Windows you always get such messages three times. What's relevant is that the "release" part of the project file is the active one.