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.
This commit is contained in:
parent
558a779123
commit
e6182f5d5d
|
@ -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
|
||||
)
|
||||
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_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
|
||||
)
|
||||
|
||||
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")
|
||||
|
|
Loading…
Reference in New Issue