[CMake] Fwd: How pass a -spec parameter to FindQt4.cmake?

Daniel Näslund dannas at dannas.name
Wed Jul 20 10:42:33 EDT 2011


---------- Forwarded message ----------
From: Daniel Näslund <dannas at dannas.name>
Date: Wed, Jul 20, 2011 at 4:41 PM
Subject: Re: [CMake] How pass a -spec parameter to FindQt4.cmake?
To: "clinton at elemtech.com" <clinton at elemtech.com>


Hi Clint and thanks for your advices (sorry about the delayed answer),

On Tue, Jul 19, 2011 at 1:33 AM, clinton at elemtech.com
<clinton at elemtech.com> wrote:
> When cross compiling, only some the qmake queries are actually used.
>
> Finding the rest just works if subdirs in the Qt installation weren't given
> different values when running Qt's configure script (e.g. --libdir=mylib or
> --libdir=lib/qt4).
>
> So, the root of the Qt installation needs to be given in the toolchain file.
>  Is /opt/env/lenny-ppc/usr/lib/qt4 the root of the installation, or the
> location of the libraries?

> In either case, it won't be searched unless you put that in your toolchain
> file.  The standard cross compile find variables are the global variables you
> can setto help find Qt.

I included /opt/env/lenny-ppc/usr/share/qt4 (which I belive to be the root of
the Qt installation) in CMAKE_FIND_ROOT_PATH but the Qt libraries still wasn't
detected.

> Then, if you need to help it some more, you may set the path to the QtCore
> library manually, or other variables manually.

Managed to compile and link when I added the following snippet to the
toolchain file:

   set(QT_HEADERS_DIR /opt/env/lenny-ppc/usr/lib)
   set(QT_LIBRARY_DIR /opt/env/lenny-ppc/usr/include/qt4)

   set(QT_QTCORE_LIBRARY /opt/env/lenny-ppc/usr/lib/libQtCore.so)
   set(QT_QTCORE_LIBRARY_RELEASE /opt/env/lenny-ppc/usr/lib/libQtCore.so)
   set(QT_QTCORE_INCLUDE_DIR /opt/env/lenny-ppc/usr/include/qt4)

   set(QT_QTDBUS_LIBRARY /opt/env/lenny-ppc/usr/lib/libQtDBus.so)
   set(QT_QTDBUS_LIBRARY_RELEASE /opt/env/lenny-ppc/usr/lib/libQtDBus.so)
   set(QT_QTDBUS_INCLUDE_DIR /opt/env/lenny-ppc/usr/include/qt4)

   set(QT_QTXML_LIBRARY /opt/env/lenny-ppc/usr/lib/libQtXml.so)
   set(QT_QTXML_LIBRARY_RELEASE /opt/env/lenny-ppc/usr/lib/libQtXml.so)
   set(QT_QTXML_INCLUDE_DIR /opt/env/lenny-ppc/usr/include/qt4)

Would have been nice if I didn't have to set those paths explicitely.
Will continue the digging.

> If lib/qt4 is another path that should be searched automatically, let us
> know, and we can add it to FindQt4.cmake.

My bad, the usr/lib/qt4 directory only contains the plugins dir.

Daniel


More information about the CMake mailing list