[projmgr] Add native CMake project support - #2571
Conversation
Parse and validate CMake project entries, generate corresponding cbuild metadata, and handle device and output settings without CMSIS project processing.
1018c4a to
685b969
Compare
Test Results 2 files 14 suites 13m 47s ⏱️ Results for commit a25b6c5. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR adds native CMake project support to ProjMgr so CMSIS solutions can orchestrate non-CProject builds via cmake: project descriptors, emitting the appropriate .cbuild.yml, .cbuild-run.yml, and .cbuild-idx.yml metadata.
Changes:
- Extends the solution schema + YAML parsing to accept
cmake:entries (mutually exclusive withproject/west) and carry CMake-specific build metadata (source, generator, configure options, target, images, device). - Updates build processing and emitters to treat CMake contexts specially (e.g., skip some CProject-specific nodes, tag
.cbuild-idx.ymlentries withcmake: true, and map declared CMake images into output metadata). - Adds unit test coverage + test data for inferred/explicit CMake project IDs, image outputs, device selection, and generated run/index files.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/projmgr/test/src/ProjMgrUnitTests.cpp | Adds a unit test validating generated cbuild/cbuild-run/cbuild-idx outputs for CMake projects. |
| tools/projmgr/test/data/CmakeSupport/solution.csolution.yml | Adds test input solution demonstrating cmake: project descriptors (explicit + inferred project-id). |
| tools/projmgr/src/ProjMgrYamlParser.cpp | Parses cmake: descriptors under projects: and extends validation key lists. |
| tools/projmgr/src/ProjMgrWorker.cpp | Adds CMake context initialization, device precedence handling, and output filename/image handling for CMake builds. |
| tools/projmgr/src/ProjMgrCbuildIdx.cpp | Adds cmake: true flag emission and avoids emitting cdefault for CMake contexts. |
| tools/projmgr/src/ProjMgrCbuild.cpp | Emits build.cmake node in generated .cbuild.yml and suppresses non-applicable nodes for CMake contexts. |
| tools/projmgr/src/ProjMgr.cpp | Treats CMake projects as valid “projects found” to avoid false errors. |
| tools/projmgr/schemas/common.schema.json | Adds cmake project schema, project-id constraints, and cmake flags in cbuild-idx/cbuild descriptors. |
| tools/projmgr/include/ProjMgrYamlParser.h | Adds YAML key constants for cmake fields. |
| tools/projmgr/include/ProjMgrWorker.h | Adds CMake descriptor + cmakeOn flag to ContextItem. |
| tools/projmgr/include/ProjMgrParser.h | Introduces CmakeDesc/CmakeImage and tracks cmakeApps in the parsed solution. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2571 +/- ##
==========================================
+ Coverage 72.09% 72.13% +0.04%
==========================================
Files 185 185
Lines 30129 30198 +69
Branches 17747 17807 +60
==========================================
+ Hits 21722 21784 +62
- Misses 6102 6107 +5
- Partials 2305 2307 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Fixes
Changes
cmakeproject descriptors to solution schemas and parsing, with mutually exclusive CProject, West, and CMake entries.This enables CMSIS solutions to orchestrate native CMake projects without applying CProject-specific processing.
Checklist