diff options
author | Li Xinwei <1326710505@qq.com> | 2020-12-08 01:56:40 +0800 |
---|---|---|
committer | Li Xinwei <1326710505@qq.com> | 2020-12-08 02:34:59 +0800 |
commit | e6e262da1423bcb7cfe3db9f83fe0df54483c8d4 (patch) | |
tree | fd9d4fbd53139b18da670682e34e93d07fd2fbd2 /tools/qmltime | |
parent | 1febf3da07919d48c704b8fdf9dbf654fbcb8a34 (diff) |
Use load(qt_tool) and qt_internal_add_tool for qmltime
The qmltime should be a tool, not a normal executable or an app.
Pick-to: 6.0 5.15 5.12
Change-Id: I64c76877907297a6a817ba5903786bcc7fba8fdd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tools/qmltime')
-rw-r--r-- | tools/qmltime/.prev_CMakeLists.txt | 32 | ||||
-rw-r--r-- | tools/qmltime/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tools/qmltime/qmltime.pro | 3 |
3 files changed, 41 insertions, 7 deletions
diff --git a/tools/qmltime/.prev_CMakeLists.txt b/tools/qmltime/.prev_CMakeLists.txt new file mode 100644 index 0000000000..71a1d76666 --- /dev/null +++ b/tools/qmltime/.prev_CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from qmltime.pro. + +##################################################################### +## qmltime Tool: +##################################################################### + +qt_get_tool_target_name(target_name qmltime) +qt_internal_add_tool(${target_name} + TARGET_DESCRIPTION "QML Time" + SOURCES + qmltime.cpp qmltime.h + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::Quick + Qt::QuickPrivate +) + +#### Keys ignored in scope 1:.:.:qmltime.pro:<TRUE>: +# QMAKE_TARGET_DESCRIPTION = "QML" "Time" +# QML_IMPORT_NAME = "QmlTime" +# QML_IMPORT_VERSION = "1.0" + +## Scopes: +##################################################################### + +set_target_properties(${target_name} PROPERTIES + QT_QML_MODULE_VERSION 1.0 + QT_QML_MODULE_URI QmlTime +) + +qt6_qml_type_registration(${target_name}) diff --git a/tools/qmltime/CMakeLists.txt b/tools/qmltime/CMakeLists.txt index 95794e8135..b119325471 100644 --- a/tools/qmltime/CMakeLists.txt +++ b/tools/qmltime/CMakeLists.txt @@ -1,11 +1,13 @@ # Generated from qmltime.pro. ##################################################################### -## qmltime Binary: +## qmltime Tool: ##################################################################### -qt_internal_add_executable(qmltime - GUI +qt_get_tool_target_name(target_name qmltime) +qt_internal_add_tool(${target_name} + TARGET_DESCRIPTION "QML Time" + TOOLS_TARGET Qml # special case SOURCES qmltime.cpp qmltime.h PUBLIC_LIBRARIES @@ -19,14 +21,13 @@ qt_internal_add_executable(qmltime # QMAKE_TARGET_DESCRIPTION = "QML" "Time" # QML_IMPORT_NAME = "QmlTime" # QML_IMPORT_VERSION = "1.0" -# TEMPLATE = "app" ## Scopes: ##################################################################### -set_target_properties(qmltime PROPERTIES +set_target_properties(${target_name} PROPERTIES QT_QML_MODULE_VERSION 1.0 QT_QML_MODULE_URI QmlTime ) -qt6_qml_type_registration(qmltime) +qt6_qml_type_registration(${target_name}) diff --git a/tools/qmltime/qmltime.pro b/tools/qmltime/qmltime.pro index c915f6e8c1..366d90f75b 100644 --- a/tools/qmltime/qmltime.pro +++ b/tools/qmltime/qmltime.pro @@ -1,4 +1,3 @@ -TEMPLATE = app TARGET = qmltime QT += qml quick QT += quick-private @@ -12,3 +11,5 @@ QMAKE_TARGET_DESCRIPTION = QML Time SOURCES += qmltime.cpp HEADERS += qmltime.h + +load(qt_tool) |