Hi CMake developers,

as I need to maintain different projects using different Qt versions, I needed 
to have a look at FindQt4.cmake.

Based on the path of qmake, I can successfully decide which Qt version is used 
(for example using Debian's update-alternatives).

Ex:
/opt/qt4.7 (custom version)
/usr/include/qt4 (default version)

However, even if I set qmake to the directory of the custom version, I see 
that cmake uses the headers of the default version.

It seems to me like a regression in commit 
0ae8a3405bb32afadda13f43100484e85f7ef74f ("Add qt4/QtCore to help find Qt 
headers when cross-compiling.")

qt4/QtCore is found in /usr/include instead of /opt/qt4.7/include, in 
contradiction with the qmake information (qmake -query QT_INSTALL_HEADERS).

Corresponding lines in FindQt4.make:
      FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
                HINTS ${qt_headers} ${QT_LIBRARY_DIR}
                PATH_SUFFIXES QtCore qt4/QtCore
        )

Removing qt4/QtCore fixes the problem, but I guess that the commit was useful 
for other reasons :)
So my suggestion is to either revert the commit because it invalidates a 
common scenario when using cmake with several Qt installations, or to fix the 
FIND_PATH call, making sure that the custom location is found before the 
default one.

Any idea?

Best regards,
Benoit.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to