forked from qt-creator/qt-creator
McuSupport: Simplify template integration
To simplify how users integrate their projects with Qul, Qul related template files are placed under the "qmlproject" subfolder. Task-number: QTCREATORBUG-29114 Change-Id: I984f1619547951e0518790c843987f03b7daa62a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -20,5 +20,6 @@
|
|||||||
<file>wizards/qmlproject/module.qmlproject.tpl</file>
|
<file>wizards/qmlproject/module.qmlproject.tpl</file>
|
||||||
<file>wizards/qmlproject/component.qml.tpl</file>
|
<file>wizards/qmlproject/component.qml.tpl</file>
|
||||||
<file>wizards/qmlproject/wizard.json</file>
|
<file>wizards/qmlproject/wizard.json</file>
|
||||||
|
<file>wizards/qmlproject/Qul.cmake</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -4,5 +4,4 @@ project(%{CorrectedProjectName} VERSION 0.0.1 LANGUAGES C CXX ASM)
|
|||||||
|
|
||||||
find_package(Qul)
|
find_package(Qul)
|
||||||
|
|
||||||
qul_add_target(%{CorrectedProjectName} QML_PROJECT %{QmlProjectFile} GENERATE_ENTRYPOINT)
|
add_subdirectory(qmlproject)
|
||||||
app_target_setup_os(%{CorrectedProjectName})
|
|
||||||
|
|||||||
3
src/plugins/mcusupport/wizards/qmlproject/Qul.cmake
Normal file
3
src/plugins/mcusupport/wizards/qmlproject/Qul.cmake
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
qul_add_target(%{CorrectedProjectName} QML_PROJECT %{QmlProjectFile} GENERATE_ENTRYPOINT)
|
||||||
|
app_target_setup_os(%{CorrectedProjectName})
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
"options":
|
"options":
|
||||||
[
|
[
|
||||||
|
{ "key": "QmlProjectDirectory", "value": "%{ProjectDirectory}/qmlproject"},
|
||||||
{ "key": "CorrectedProjectName", "value": "%{JS: '%{ProjectName}'.replace(/-/g, '_')}"},
|
{ "key": "CorrectedProjectName", "value": "%{JS: '%{ProjectName}'.replace(/-/g, '_')}"},
|
||||||
{ "key": "MainQmlFile", "value": "%{CorrectedProjectName}.qml" },
|
{ "key": "MainQmlFile", "value": "%{CorrectedProjectName}.qml" },
|
||||||
{ "key": "QmlProjectFile", "value": "%{CorrectedProjectName}.qmlproject" },
|
{ "key": "QmlProjectFile", "value": "%{CorrectedProjectName}.qmlproject" },
|
||||||
@@ -55,49 +56,54 @@
|
|||||||
"source": "CMakeLists.txt",
|
"source": "CMakeLists.txt",
|
||||||
"openAsProject": true
|
"openAsProject": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"source": "Qul.cmake",
|
||||||
|
"target": "%{QmlProjectDirectory}/CMakeLists.txt",
|
||||||
|
"openInEditor": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"source": "BackendObject.h",
|
"source": "BackendObject.h",
|
||||||
"target": "%{ProjectDirectory}/src/%{InterfaceFile}",
|
"target": "%{QmlProjectDirectory}/src/%{InterfaceFile}",
|
||||||
"openInEditor": true
|
"openInEditor": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "component.qml.tpl",
|
"source": "component.qml.tpl",
|
||||||
"target": "%{ProjectDirectory}/imports/CustomModule/%{QmlComponent}",
|
"target": "%{QmlProjectDirectory}/imports/CustomModule/%{QmlComponent}",
|
||||||
"openInEditor": true
|
"openInEditor": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "module.qmlproject.tpl",
|
"source": "module.qmlproject.tpl",
|
||||||
"target": "%{ProjectDirectory}/imports/CustomModule/%{ModuleFile}",
|
"target": "%{QmlProjectDirectory}/imports/CustomModule/%{ModuleFile}",
|
||||||
"openInEditor": true
|
"openInEditor": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "project.qmlproject.tpl",
|
"source": "project.qmlproject.tpl",
|
||||||
"target": "%{ProjectDirectory}/%{QmlProjectFile}",
|
"target": "%{QmlProjectDirectory}/%{QmlProjectFile}",
|
||||||
"openInEditor": true
|
"openInEditor": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "main.qml.tpl",
|
"source": "main.qml.tpl",
|
||||||
"target": "%{ProjectDirectory}/%{MainQmlFile}",
|
"target": "%{QmlProjectDirectory}/%{MainQmlFile}",
|
||||||
"openInEditor": true
|
"openInEditor": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "../icon.png",
|
"source": "../icon.png",
|
||||||
"target": "%{ProjectDirectory}/images/icon.png",
|
"target": "%{QmlProjectDirectory}/images/icon.png",
|
||||||
"isBinary": true
|
"isBinary": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "DejaVuSansMono.ttf",
|
"source": "DejaVuSansMono.ttf",
|
||||||
"target": "%{ProjectDirectory}/fonts/DejaVuSansMono.ttf",
|
"target": "%{QmlProjectDirectory}/fonts/DejaVuSansMono.ttf",
|
||||||
"isBinary": true
|
"isBinary": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "LICENSE",
|
"source": "LICENSE",
|
||||||
"target": "%{ProjectDirectory}/fonts/LICENSE",
|
"target": "%{QmlProjectDirectory}/fonts/LICENSE",
|
||||||
"isBinary": true
|
"isBinary": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "translation.nb_NO.ts",
|
"source": "translation.nb_NO.ts",
|
||||||
"target": "%{ProjectDirectory}/translations/%{TsFile}",
|
"target": "%{QmlProjectDirectory}/translations/%{TsFile}",
|
||||||
"openInEditor": false
|
"openInEditor": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user