CPS: Be less optimistic about what we can read

Previously, `cmPackageInfoReader` made the wildly optimistic assumption
that it will know how to read any CPS version that is less than 1.0
(note, the current version as of writing is 0.13). This is likely not a
safe assumption. Assume instead that we only know how to read the
current minor version, i.e. 0.13.x. This still allows room for the
specification to make non-breaking changes, while also providing a
better path for making breaking changes without CMake wrongly thinking
it still understands what it's reading.
This commit is contained in:
Matthew Woehlke
2025-12-09 15:13:48 -05:00
parent 20e81dbd5e
commit 039a7b936d

View File

@@ -129,7 +129,7 @@ bool CheckSchemaVersion(Json::Value const& data)
// Check that we understand this version.
return cmSystemTools::VersionCompare(cmSystemTools::OP_GREATER_EQUAL,
version, "0.13") &&
cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, version, "1");
cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, version, "0.14");
// TODO Eventually this probably needs to return the version tuple, and
// should share code with cmPackageInfoReader::ParseVersion.