PDA

View Full Version : qmake doesn't respect QMAKESPEC variable



piotr.dobrogost
18th July 2009, 20:22
I wanted to use vc++ compiler from within Qt Creator. Therefore I set QMAKESPEC environment variable in Projects/Build Settings/Debug to c:\qt\4.5.2-vc\mkspecs\win32-msvc2008 where I have qt compiled with vc++ compiler.
But when building a project I get this error
Starting: C:/qt/4.5.2-vc/bin/qmake.exe D:/projects/qt-test/formextractor.pro -spec Z:/qt-src/mkspecs/win32-g++ -r
Failure to read QMAKESPEC conf file z:/qt-src/mkspecs/win32-g++\qmake.conf.

Why qmake doesn't read QMAKESPEC variable and instead keeps using z:/qt-src/mkspecs/win32-g++\qmake.conf as a value of spec option?
How can I fix this?

fullmetalcoder
18th July 2009, 22:24
Why qmake doesn't read QMAKESPEC variable and instead keeps using z:/qt-src/mkspecs/win32-g++\qmake.conf as a value of spec option?
qmake does what it is told. Considering the output it is clear that qmake is invoked with a -spec parameter which overrides any environment variable.


How can I fix this?
Beat your IDE to death until it understands that it should not specify a QMAKESPEC when invoking qmake (that probably boils down to some settings).

edit: are you really setting an environment variable btw (as opposed to ome settings of Qt Creator)? Because it might just be that you set the mkspec properly for debug mode (inferred from your explanations) yet are building in release mode...

piotr.dobrogost
18th July 2009, 22:38
It happens when I'm building debugging helper using built-in function of Qt Creator (Tools/Options/Qt4/Qt Versions/Rebuild)...
From what I see creator builds it using makefiles in /qtc-debugging-helper folder. These makefiles had the wrong path (it was the original path of qt's source when building qt). I changed it to the proper one but when rebuilding creator still uses the old, wrong one. I have no idea where does it take it from.
Any ideas?

wysota
19th July 2009, 21:39
Why don't you just change the contents of mkspecs/default/qmake.conf?

piotr.dobrogost
19th July 2009, 22:03
Why don't you just change the contents of mkspecs/default/qmake.conf?

How could I know I should change this file?
Where can I find information on setting creator to work with vc?

wysota
19th July 2009, 22:08
How could I know I should change this file?
Open it and read it through. It's trivial to guess what you are looking for, there is only one path there. Think what you have to do with the file to get it to work with a different compiler and different path by default and just do it.