Details
-
Epic
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Improvement to MCU project template
Description
The root project should always be a qmlproject, not a CMake project
Under the root project, there can be multiple targets: always at least desktop, but also any number of MCUs.
In the project creation wizard, the user could choose one or several targets, which would trigger qmlprojectexporter to add all the needed platform files under a subfolder (or other configurable folder) for that target, and also containing a standalone CMake project itself referencing the root qmlproject. It would also create the kit for that target and associate it with the sub-project.
A mockup of how this could look like has been drafted here:
Should QUL core sources export be a dependency?
For each target sub-project, a different set of QUL core libs should be included. If QUL sources are available in the Qt for MCUs install folder (full commercial), they should be copied in each target sub-project (this would allow different configurations for different targets). If QUL sources are not available (eval), the sub-project should link to pre-built binaries.
Other features:
- The active target should be highlighted in in the project explorer, and an action should be available to change the active target, which would also automatically update the active kit
- When changing the kit, the active sub-project in the project explorer should automatically be updated to match
- Add or remove target sub-projects from a root project, which would also add or remove kits associated with the project
- Optional: a way to upgrade a target's platform sources with a newer version. If the sources in the application have changed, a warning should be given, asking if the user wants to replace the old platform sources with the new ones from Qt for MCUs. We could be using Qt Creator's diff viewer to compare the difference, and use some tool to do the merge. If not implemented, the user would simply have to do this upgrade manually with the tools of their choice.
- Optional: upgrade all standard examples/demos/tests to use that structure and approach. At the very least, we need to test in CI the approach from this template.
- Action to export the root project to another IDE
- A way to switch a target sub-project's QUL libs configuration: use prebuilt QUL libs or include QUL core sources
The MCU template project in Qt Creator could be improved with the following:
Both "empty" and "full" templates:
- A 'main.cpp' file should be included, rather than relying on the auto-generated one from the 'GENERATE_ENTRYPOINT' option
Only 'full' template:
- The CustomModule should also include a .cpp file to demonstrate UL-8355
- The C++ backend should be split as separate .h and .cpp files
- Following the approach in the QDS project template, there could be a Constants module