qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
When I install this distribution I type some install path, for example d:\qt\4.3.1-shared, in one of install wizard pages. When installation is complete I found that d:\qt\4.3.1-shared\bin\qmake.exe has this install path hard-coded into it. So I would like to know how they do it?
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
How do you know it is hardcoded?
EDIT:
would it be because qmake -v outputs something like:
Quote:
QMake version 2.01a
Using Qt version 4.3.0 in D:\dev\Qt\4.3.0\lib
:)
The version is not hardcoded. It must check the QTDIR variable.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Quote:
Originally Posted by
marcel
would it be because qmake -v outputs something like...
Нет, блин, не поэтому. It because I open qmake.exe as text file and found these path strings there ;)
These strings I found in qmake.exe after mentioned in subj distr was installed in f:\qt\4.3.1-g++:
qt_prfxpath=F:\qt\4.3.1-g++
qt_docspath=F:\qt\4.3.1-g++\doc
qt_hdrspath=F:\qt\4.3.1-g++\include
qt_libspath=F:\qt\4.3.1-g++\lib
qt_binspath=F:\qt\4.3.1-g++\bin
qt_plugpath=F:\qt\4.3.1-g++\plugins
qt_datapath=F:\qt\4.3.1-g++
qt_trnspath=F:\qt\4.3.1-g++\translations
qt_xmplpath=F:\qt\4.3.1-g++\examples
qt_demopath=F:\qt\4.3.1-g++\demos
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Quote:
Нет, блин, не поэтому.
What does that mean?
Anyway, qmake is compiled on the fly, by the installer. That is why/how the paths get in there.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Quote:
Originally Posted by
marcel
What does that mean?
This mean "No, not therefore" :)
Quote:
Originally Posted by
marcel
Anyway, qmake is compiled on the fly, by the installer. That is why/how the paths get in there.
So, I would like to know details, compiling qmake is not quick task, but installation runs quite quickly.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
HThe qmake project is not big and it does not take a long time to compile. You can check for that yourself. See the qmake dir in your QTDIR.
I assume that qmake is compiled after mingw is downloaded/installed. That is the only explanation.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Compiling qmake manualy takes more time than installing from that distr.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Quote:
Originally Posted by
marcel
I assume that qmake is compiled after mingw is downloaded/installed. That is the only explanation.
That is not only one explanation. I have learn details during instalation process and I can to say following:
1. Almost all is "Extracting <some file>...";
2. At the last steps there are many "Pathing <some name>.prl...";
3. And finaly there are two strings in details: "Patching paths in qmake..." and "Patching paths in core...".
So you can see nowhere is compiling qmake.
I would like to know what they do at that patching step (qmake and core patching).
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
The behaviour is correct
-> qt.conf is your friend
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Quote:
Originally Posted by
ChristianEhrlicher
The behaviour is correct
-> qt.conf is your friend
I prefer don't use qt.conf. I would like to do it using the same way as trolls - to patch qmake and core.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
But what if the patching is done by the installer?
Look at option.h, from the qmake project:
Code:
{
public:
enum LibraryLocation
{
PrefixPath,
DocumentationPath,
HeadersPath,
LibrariesPath,
BinariesPath,
PluginsPath,
DataPath,
TranslationsPath,
SettingsPath,
DemosPath,
ExamplesPath
};
static QString location
(LibraryLocation
);
};
This is the class used to access the paths. It is a minimal version of QLibraryInfo.
The paths are written by (and ONLY by) configure. Take a look in configureapp.cpp( from tools) in function Configure::generateConfigfiles(). Here is the only time those values are written somewhere.
This leads me to believe that the installer actually uses configure to initially configure the destination paths, and it modifies qmake.
There is no other explanation, or I don't see it right now.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Today I wrote patch that patchs qmake and QtCore(d)4.dll. It was written using Qt so it takes just about 50 lines of code. It's realy works but one issue is still remain. At debugging I can't step into any Qt function (or class method) because it tries to use old src dir.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
The code for patching qmake was already in configureapp.cpp.
And why would you need to patch Qt yourself... Should have asked that from the beginning.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Quote:
Originally Posted by
marcel
The code for patching qmake was already in configureapp.cpp.
And why would you need to patch Qt yourself... Should have asked that from the beginning.
First of all, I didn't know that patch code in that file. Second, it is more easy to write my own code than to find it there.
I would need to patch Qt myself because I want to create my own installer.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Quote:
Second, it is more easy to write my own code than to find it there.
It would have been faster if you just reused that code.
That's the whole idea of open source.
Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it
Quote:
Originally Posted by
marcel
It would have been faster if you just reused that code.
That's the whole idea of open source.
First reason is main reason (I didn't know).