summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-01-24 11:55:21 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-01-28 20:04:10 (GMT)
commite6182f5d5d5b93268b453dc099df6fe7b8cdbb11 (patch)
tree889149700d31480a9cd28fbd01182bd4e8f93614 /Modules/FindQt4.cmake
parent558a7791233cecd9f87b8bd9caa9fcca58ef5d8b (diff)
downloadCMake-e6182f5d5d5b93268b453dc099df6fe7b8cdbb11.zip
CMake-e6182f5d5d5b93268b453dc099df6fe7b8cdbb11.tar.gz
CMake-e6182f5d5d5b93268b453dc099df6fe7b8cdbb11.tar.bz2
Qt4: Create IMPORTED executable targets for all Qt executables.
Qt 5 already has similar IMPORTED targets. The versioned namespace will allow de-conflicting the variable names between Qt 4 and Qt 5.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake86
1 files changed, 22 insertions, 64 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 0bf2b99..2d2feae 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1185,71 +1185,29 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
set(QT_LINGUIST_EXECUTABLE NOTFOUND)
endif()
- find_program(QT_MOC_EXECUTABLE
- NAMES moc-qt4 moc moc4
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_UIC_EXECUTABLE
- NAMES uic-qt4 uic uic4
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_UIC3_EXECUTABLE
- NAMES uic3
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_RCC_EXECUTABLE
- NAMES rcc
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_DBUSCPP2XML_EXECUTABLE
- NAMES qdbuscpp2xml
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_DBUSXML2CPP_EXECUTABLE
- NAMES qdbusxml2cpp
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_LUPDATE_EXECUTABLE
- NAMES lupdate-qt4 lupdate lupdate4
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_LRELEASE_EXECUTABLE
- NAMES lrelease-qt4 lrelease lrelease4
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE
- NAMES qcollectiongenerator-qt4 qcollectiongenerator
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
-
- find_program(QT_DESIGNER_EXECUTABLE
- NAMES designer-qt4 designer designer4
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
+ macro(_find_qt4_program VAR NAME)
+ find_program(${VAR}
+ NAMES ${ARGN}
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
+ )
+ if (${VAR} AND NOT TARGET ${NAME})
+ add_executable(${NAME} IMPORTED)
+ set_property(TARGET ${NAME} PROPERTY IMPORTED_LOCATION ${${VAR}})
+ endif()
+ endmacro()
- find_program(QT_LINGUIST_EXECUTABLE
- NAMES linguist-qt4 linguist linguist4
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
+ _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_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_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)
if (QT_MOC_EXECUTABLE)
set(QT_WRAP_CPP "YES")