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:
Yasser Grimes
2023-05-31 16:44:41 +03:00
parent 270972c7bb
commit f146bebbc7
4 changed files with 20 additions and 11 deletions

View File

@@ -20,5 +20,6 @@
<file>wizards/qmlproject/module.qmlproject.tpl</file>
<file>wizards/qmlproject/component.qml.tpl</file>
<file>wizards/qmlproject/wizard.json</file>
<file>wizards/qmlproject/Qul.cmake</file>
</qresource>
</RCC>

View File

@@ -4,5 +4,4 @@ project(%{CorrectedProjectName} VERSION 0.0.1 LANGUAGES C CXX ASM)
find_package(Qul)
qul_add_target(%{CorrectedProjectName} QML_PROJECT %{QmlProjectFile} GENERATE_ENTRYPOINT)
app_target_setup_os(%{CorrectedProjectName})
add_subdirectory(qmlproject)

View File

@@ -0,0 +1,3 @@
qul_add_target(%{CorrectedProjectName} QML_PROJECT %{QmlProjectFile} GENERATE_ENTRYPOINT)
app_target_setup_os(%{CorrectedProjectName})

View File

@@ -12,6 +12,7 @@
"options":
[
{ "key": "QmlProjectDirectory", "value": "%{ProjectDirectory}/qmlproject"},
{ "key": "CorrectedProjectName", "value": "%{JS: '%{ProjectName}'.replace(/-/g, '_')}"},
{ "key": "MainQmlFile", "value": "%{CorrectedProjectName}.qml" },
{ "key": "QmlProjectFile", "value": "%{CorrectedProjectName}.qmlproject" },
@@ -55,49 +56,54 @@
"source": "CMakeLists.txt",
"openAsProject": true
},
{
"source": "Qul.cmake",
"target": "%{QmlProjectDirectory}/CMakeLists.txt",
"openInEditor": false
},
{
"source": "BackendObject.h",
"target": "%{ProjectDirectory}/src/%{InterfaceFile}",
"target": "%{QmlProjectDirectory}/src/%{InterfaceFile}",
"openInEditor": true
},
{
"source": "component.qml.tpl",
"target": "%{ProjectDirectory}/imports/CustomModule/%{QmlComponent}",
"target": "%{QmlProjectDirectory}/imports/CustomModule/%{QmlComponent}",
"openInEditor": true
},
{
"source": "module.qmlproject.tpl",
"target": "%{ProjectDirectory}/imports/CustomModule/%{ModuleFile}",
"target": "%{QmlProjectDirectory}/imports/CustomModule/%{ModuleFile}",
"openInEditor": true
},
{
"source": "project.qmlproject.tpl",
"target": "%{ProjectDirectory}/%{QmlProjectFile}",
"target": "%{QmlProjectDirectory}/%{QmlProjectFile}",
"openInEditor": true
},
{
"source": "main.qml.tpl",
"target": "%{ProjectDirectory}/%{MainQmlFile}",
"target": "%{QmlProjectDirectory}/%{MainQmlFile}",
"openInEditor": true
},
{
"source": "../icon.png",
"target": "%{ProjectDirectory}/images/icon.png",
"target": "%{QmlProjectDirectory}/images/icon.png",
"isBinary": true
},
{
"source": "DejaVuSansMono.ttf",
"target": "%{ProjectDirectory}/fonts/DejaVuSansMono.ttf",
"target": "%{QmlProjectDirectory}/fonts/DejaVuSansMono.ttf",
"isBinary": true
},
{
"source": "LICENSE",
"target": "%{ProjectDirectory}/fonts/LICENSE",
"target": "%{QmlProjectDirectory}/fonts/LICENSE",
"isBinary": true
},
{
"source": "translation.nb_NO.ts",
"target": "%{ProjectDirectory}/translations/%{TsFile}",
"target": "%{QmlProjectDirectory}/translations/%{TsFile}",
"openInEditor": false
},
{