[CMake] Qt4 QT_INSTALL_LIBS

Andreas Pakulat apaku at gmx.de
Thu Nov 14 07:25:06 EST 2013


Hi,

On Thu, Nov 14, 2013 at 11:45 AM, Lars Lars <laasunde at hotmail.com> wrote:

> Using CMake 2.8.10 on Windows 7.
>
> We have a working project that finds QT liket this:
> FIND_PACKAGE(Qt4 4.7.1 COMPONENTS QtCore QtGui)
>
> Now we would like to update Qt library, so changed it to:
> FIND_PACKAGE(Qt4 4.8.4 COMPONENTS QtCore QtGui)
>
> This however fails because FindQt4.cmake execute "qmake -query
> QT_INSTALL_LIBS" which returns the path where the Qt library was built. We
> however store Qt in another location in our development setup. How can is
> solved this issue without rebuilding the Qt library in the same path as the
> development setup?
>

Your Qt won't work from that place as it is either. Qt is not relocatable,
the path to the install location is hardcoded into the tools. If you build
a Qt project with qmake it'll also generate compiler commands that point to
the non-existing install location.

You can make the Qt installation relocatable by adding a qt.conf file and
qmake will pick this up as well, see the Qt docs for more information:
http://qt-project.org/doc/qt-4.8/qt-conf.html.

What is the rational behind querying qmake for the the location of the
> libs?
>

Because qmake knows best where the libs are. There are various ways of
customizing the structure and the structure can be different across
platform.

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131114/38cca07c/attachment.htm>


More information about the CMake mailing list