[Qt-interest] qmake and absolute paths pointing to Qt build directory

Andreas Pakulat apaku at gmx.de
Thu Jan 21 12:03:33 CET 2010


On 21.01.10 11:46:19, Alexander Kurz wrote:
> We would like to build Qt for all our platforms only once and then
> distribute this build among all developers so that everyone is using exactly
> the same and does not need to bother building Qt by himself. This is also
> beneficial when we rebuild Qt (e.g. to minimize footprint for embedded).
> 
> The idea was do use QTDIR env variable to point to the Qt directory to use

That variable has been deprecated by Qt Software/Trolltech with the
introduction of Qt4.0 and is not use by any Qt code anymore.

> and also use QMAKESPEC accordingly.
> 
> The problem is that qmake creates makefiles with absolute paths to the Qt
> build directory when trying to build an application.
> This requires each developer and also buildserver to copy Qt build to the
> same directory.
> 
> Is there a easy solution for it?

Well, you could check how the Qt binary packages do the relocation. I've
recently read on the pyqt list that a small utility replaces the paths in
the binaries. See
http://www.riverbankcomputing.com/pipermail/pyqt/2010-January/025572.html

Another solution used by the KDE/Windows team is a qt.conf file that has
the paths adjusted as needed. You should find examples for that on the web.

> For me it looks like I have to dig deeper into the mkspecs and modify here
> and there because also default include/lib paths are absolute to the Qt
> build directory.

At least on linux the mkspecs use variables that are hardcoded inside the
qmake binary (and can be adjusted as above) to find out the location of
headers/libs, see common/linux.conf for example.

Andreas

-- 
You have an ability to sense and know higher truth.



More information about the Qt-interest-old mailing list