Browse Source

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.
Matthew Woehlke 8 months ago
parent
commit
83b22da7ac
2 changed files with 1 additions and 2 deletions
  1. 1 1
      Source/cmPackageInfoReader.cxx
  2. 0 1
      Tests/FindPackageCpsTest/cps/[email protected]

+ 1 - 1
Source/cmPackageInfoReader.cxx

@@ -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;
   }
 

+ 0 - 1
Tests/FindPackageCpsTest/cps/[email protected]

@@ -1,5 +1,4 @@
 {
-  "cps_version": "0.13",
   "name": "Foo",
   "configuration": "default",
   "components": {