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
_______________________________________________
cmake-developers mailing list
[email protected]
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to