cmPackageInfoReader: Inherit cps_version

Modify cmPackageInfoReader to not require schema_version in supplemental
files (i.e. appendices and/or configuration-specific files). This is
important as our own generation is not including cps_version in
supplemental files, and it is forbidden in the same according to a
strict reading of the specification.
This commit is contained in:
Matthew Woehlke
2025-02-11 12:32:46 -05:00
parent caff0d62c6
commit 83b22da7ac
2 changed files with 1 additions and 2 deletions
+1 -1
View File
@@ -376,7 +376,7 @@ std::unique_ptr<cmPackageInfoReader> cmPackageInfoReader::Read(
// - the input is a JSON object
// - the input has a "cps_version" that we (in theory) know how to parse
Json::Value data = ReadJson(path);
if (!data.isObject() || !CheckSchemaVersion(data)) {
if (!data.isObject() || (!parent && !CheckSchemaVersion(data))) {
return nullptr;
}
@@ -1,5 +1,4 @@
{
"cps_version": "0.13",
"name": "Foo",
"configuration": "default",
"components": {