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)
|
set(QT_LINGUIST_EXECUTABLE NOTFOUND)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_program(QT_MOC_EXECUTABLE
|
macro(_find_qt4_program VAR NAME)
|
||||||
NAMES moc-qt4 moc moc4
|
find_program(${VAR}
|
||||||
PATHS ${QT_BINARY_DIR}
|
NAMES ${ARGN}
|
||||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
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
|
_find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc moc4)
|
||||||
NAMES uic-qt4 uic uic4
|
_find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic uic4)
|
||||||
PATHS ${QT_BINARY_DIR}
|
_find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3)
|
||||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
_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_program(QT_UIC3_EXECUTABLE
|
_find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate lupdate4)
|
||||||
NAMES uic3
|
_find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease lrelease4)
|
||||||
PATHS ${QT_BINARY_DIR}
|
_find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator)
|
||||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
_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_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
|
|
||||||
)
|
|
||||||
|
|
||||||
if (QT_MOC_EXECUTABLE)
|
if (QT_MOC_EXECUTABLE)
|
||||||
set(QT_WRAP_CPP "YES")
|
set(QT_WRAP_CPP "YES")
|
||||||
|
|
Loading…
Reference in New Issue