FindQt[34]: Prefer matching versioned tool names

After finding qmake we search in QT_BINARY_DIR for the other Qt tools.
Try all versioned executable names before trying the plain executable name.
This makes it much more likely that if 2 different major versions are installed
in the same prefix CMake will be able to detect a proper set of tools.
This commit is contained in:
Rolf Eike Beer 2014-05-20 17:47:54 +02:00 committed by Brad King
parent 2d5e3d2d2b
commit 0645eedb71
2 changed files with 8 additions and 8 deletions

View File

@ -161,7 +161,7 @@ find_library(QT_QASSISTANTCLIENT_LIBRARY
# Qt 3 should prefer QTDIR over the PATH
find_program(QT_MOC_EXECUTABLE
NAMES moc-qt3 moc moc3 moc3-mt
NAMES moc-qt3 moc3 moc3-mt moc
HINTS
ENV QTDIR
PATHS
@ -186,7 +186,7 @@ endif()
# Qt 3 should prefer QTDIR over the PATH
find_program(QT_UIC_EXECUTABLE
NAMES uic-qt3 uic uic3 uic3-mt
NAMES uic-qt3 uic3 uic3-mt uic
HINTS
ENV QTDIR
PATHS

View File

@ -1137,17 +1137,17 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
endif()
endmacro()
_find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc moc4)
_find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic uic4)
_find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc4 moc)
_find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic4 uic)
_find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3)
_find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc)
_find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml)
_find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp)
_find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate lupdate4)
_find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease lrelease4)
_find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate4 lupdate)
_find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease4 lrelease)
_find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator)
_find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer designer4)
_find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist linguist4)
_find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer4 designer)
_find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist4 linguist)
if (NOT TARGET Qt4::qmake)
add_executable(Qt4::qmake IMPORTED)