Commit 6efe866
feat: add CMake check to verify project version agrees with schema version (#144)
Schema version in `edm4eic.yaml` must equal `100*major + 10*minor +
patch` from `CMakeLists.txt`, but this was neither enforced nor in sync
(850 vs 860 for version 8.6.0).
## Changes
- **Fixed version mismatch**: Updated `schema_version` from 850 to 860
- **CMake check**: Fails configuration if `schema_version ≠
100*VERSION_MAJOR + 10*VERSION_MINOR + VERSION_PATCH`
The check runs at CMake configure time, extracts versions, computes
expected schema version, and fails with clear error messages on
mismatch:
```cmake
# In CMakeLists.txt - runs at configure time
math(EXPR EXPECTED_SCHEMA_VERSION "${VERSION_MAJOR} * 100 + ${VERSION_MINOR} * 10 + ${VERSION_PATCH}")
if(NOT SCHEMA_VERSION EQUAL EXPECTED_SCHEMA_VERSION)
message(FATAL_ERROR "Schema version mismatch: ...")
endif()
```
This CMake-based validation ensures any build attempt will fail if
versions are out of sync, eliminating the need for a separate CI
workflow.
Patch version changes remain schema-invariant as documented.
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>CI check to verify project version agrees with schema
version</issue_title>
> <issue_description>**Is your feature request related to a problem?
Please describe.**
> Sometimes the project version in CMakeLists.txt is updated without
updating the version number in edm4eic.yml, or the other way round.
>
> **Describe the solution you'd like**
> A small CI test should verify that the project version and schema
version are always in sync. Possibly this can also be implemented as a
CMake requirement and CMake configuration can fail in case of
disagreement.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes #143
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>1 parent 0473067 commit 6efe866
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
14 | 32 | | |
15 | 33 | | |
16 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments