[cmake-developers] [CMake] CMake 2.8.3-rc1 ready for testing!

Alexander Neundorf neundorf at kde.org
Thu Sep 23 16:01:40 EDT 2010


On Thursday 23 September 2010, Clinton Stimpson wrote:
> On Thursday, September 23, 2010 01:40:02 pm Alexander Neundorf wrote:
...
> > This was committed here:
> > http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b55da4c688bbf55b442908
> >46 4e0f7e2e41c937a3 which has as commit message "Add cross-compiling
> > support to FindQt4.cmake"
> >
> > What speaks against adding the NO_DEFAULT_PATH again ?
>
> It was removed so it would be possible to use CMAKE_PREFIX_* for cross-
> compiling with Qt.  This is because the output of "qmake -query" cannot be
> relied on when cross-compiling, because it only has native Qt paths.

We assume that the qmake which is found belongs to the Qt which is wanted, right ?
This qmake is, also when crosscompiling, a native host binary in general, right ?
Because I guess when cross compiling with qmake (not cmake), this qmake is used to generate the makefiles for cross compiling.
And this one really reports the library dir for the host, not for the cross compiling target ?

How about something like this:

GET_FILENAME_COMPONENT(_qt_base_dir ${QT_QMAKE_EXECUTABLE} PATH)
GET_FILENAME_COMPONENT(_qt_base_dir ${_qt_base_dir} PATH)
...
FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
             NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
             HINTS ${QT_LIBRARY_DIR_TMP} ${_qt_base_dir}/lib 
             NO_DEFAULT_PATH )
    )

I.e. we check only in the directory reported by qmake and additionally in {qmake_dir}/../lib/ ?
The order of the two could also be exchanged.

> So are you saying the problem only comes up if CMAKE_PREFIX_PATH contains
> the root directory of a Qt installation that you don't want to use, and
> QT_QMAKE_EXECUTABLE is set to the qmake of the installation you want to
> use?

Yes.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20100923/c50a508b/attachment.html>


More information about the cmake-developers mailing list