summaryrefslogtreecommitdiff
blob: a14e1da1a6587c8b33182bc4b223c114c3a339cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Ensure that the correct version of Qt is always used.

With the introduction qt-4.8.6, Qt binaries were moved from /usr/bin to
/usr/$(get_libdir)/qt4/bin, leaving behind in their place symlinks to qtchooser.

There is no guarantee to which version of Qt these symlinks might point, so it
is necessary to find the correct version explicitly.

Once qmake is found, it is queried for the correct location of all other items.

--- a/cmake/modules/FindQt.cmake
+++ b/cmake/modules/FindQt.cmake
@@ -19,7 +19,7 @@
 IF(NOT QT5_INSTALLED)
     IF(NOT QT_QMAKE_EXECUTABLE)
         FIND_PROGRAM(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake qmake4 qmake-qt4 qmake5 qmake-qt5
-            PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin")
+            PATHS /usr/${CMAKE_INSTALL_LIBDIR}/qt4/bin /usr/bin NO_DEFAULT_PATH)
         SET(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "Qt qmake program.")
     ENDIF(NOT QT_QMAKE_EXECUTABLE)