PDA

View Full Version : qmake enviroment variables



qtarian
28th February 2011, 11:56
Hey guys,

I have done following steps :

- I downloaded "qt-everywhere-opensource-src-4.7.1.zip"
- I compiled it with mingw with gcc version 4.5.2
- I successfully compiled my first code.

- I suddenly wanted to rename the Qt directory to something else. At this step nothing worked !
- Using online resources I did "qmake -query" and I noticed that if I change the name of Qt installation nothing would work since the internal variables are set to that. I used "qmake -set <variable> <value>" to fix this and I set all variable I saw with "qmake -query" to the new directory (the new name) .

- I am not yet able to get "qmake" work :(
- when I do "qmake -query" I see the old and new environment variables listed.
- I tried to find out where these variables are saved, but so far nothing found. I guess they are somewhere encoded. in the qmake manual it says these variables are persistent ! so if they are persistent there should be a way to delete/set them.

To be more precise : "qmake" generates "Makefile" which contains include/lib paths. These paths are set using the environment variables of "qmake". The Include/Lib paths are still pointed to the old paths not the new ones I set ! That's why I could not compile my code again.

FYI : I could not compile my code that used "fstream" with the executable SDK provided by Qt since there are things broken in their mingw build. so I had/have to compile the Qt again :(

wysota
28th February 2011, 20:01
What does qmake -query return?

qtarian
28th February 2011, 20:22
Someone is gonna help me :D

QMAKE_MKSPECS:c:/qtnew\mkspecs
QTDIR:c:\qtnew
QT_INSTALL_BINS:c:/qtnew/bin
QT_INSTALL_CONFIGURATION:c:/qtnew
QT_INSTALL_DATA:c:/qtnew
QT_INSTALL_DEMOS:c:/qtnew/demos
QT_INSTALL_DOCS:c:/qtnew/doc
QT_INSTALL_EXAMPLES:c:/qtnew/examples
QT_INSTALL_HEADERS:c:/qtnew/include
QT_INSTALL_IMPORTS:c:/qtnew/imports
QT_INSTALL_LIBS:c:/qtnew/lib
QT_INSTALL_PLUGINS:c:/qtnew/plugins
QT_INSTALL_PREFIX:c:/qtnew
QT_INSTALL_TRANSLATIONS:c:/qtnew/translations
QT_INSTALL_PREFIX:c:\qt
QT_INSTALL_DATA:c:/qt
QT_INSTALL_DOCS:c:/qt/doc
QT_INSTALL_HEADERS:c:/qt/include
QT_INSTALL_LIBS:c:/qt/lib
QT_INSTALL_BINS:c:/qt/bin
QT_INSTALL_PLUGINS:c:/qt/plugins
QT_INSTALL_IMPORTS:c:/qt/imports
QT_INSTALL_TRANSLATIONS:c:/qt/translations
QT_INSTALL_CONFIGURATION:c:/qt
QT_INSTALL_EXAMPLES:c:/qt/examples
QT_INSTALL_DEMOS:c:/qt/demos
QMAKE_MKSPECS:c:/qt\mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.7.1

wysota
28th February 2011, 21:54
Nice garbage :) I have to disapoint you, this won't work. Set all those variables you modified to empty values, then run configure.exe after you have changed the directory name, then cd into qmake directory and run mingw32-make clean and mingw32-make. Afterwards your qmake should understand the new paths.

qtarian
28th February 2011, 23:12
Thanks for the answer ! I hope what you say to do is not gonna take another 6 hours of compilation :crying:
I could do recompilation; That's why I am here :) to know how to fix it.

what do you mean garbage !? I can see from your forum ID that you are a Qt developer :rolleyes:

can you please explain me how these local variables work and where they are stored? is my build corrupted? I, as a programmer think this could be a bug that for any reason the "qmake -query" shows that it has more than one value for a variable ! No ?

why should qmake return such a list ?

thanks in advance.

wysota
28th February 2011, 23:35
Thanks for the answer ! I hope what you say to do is not gonna take another 6 hours of compilation :crying:
No, it should take up to 5 minutes. You only need to rebuild qmake, nothing more.


what do you mean garbage !?
I mean all those slashes and backslashes and doubled entries.


I can see from your forum ID that you are a Qt developer :rolleyes:
No, I'm a "Nokia certified Qt developer". I'm not developing Qt, I'm developing with Qt.


can you please explain me how these local variables work
They are used during reading .pro files.


and where they are stored?
If you are using Windows then in the registry.


is my build corrupted?
No, not really.

I, as a programmer think this could be a bug that for any reason the "qmake -query" shows that it has more than one value for a variable ! No ?
No. Those variables are read-only, you can't change them. If you try to do that, new variables with the same names get created. I can agree this can be confusing.