From 83b22da7acbd1ebd0ce8b3942ef4cfa92c36acf4 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Tue, 11 Feb 2025 12:32:46 -0500 Subject: 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. --- Source/cmPackageInfoReader.cxx | 2 +- Tests/FindPackageCpsTest/cps/foo-relative@default.cps | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/cmPackageInfoReader.cxx b/Source/cmPackageInfoReader.cxx index a5349ca..0bb3e35 100644 --- a/Source/cmPackageInfoReader.cxx +++ b/Source/cmPackageInfoReader.cxx @@ -376,7 +376,7 @@ std::unique_ptr 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; } diff --git a/Tests/FindPackageCpsTest/cps/foo-relative@default.cps b/Tests/FindPackageCpsTest/cps/foo-relative@default.cps index 19a55dd..c9e8d4f 100644 --- a/Tests/FindPackageCpsTest/cps/foo-relative@default.cps +++ b/Tests/FindPackageCpsTest/cps/foo-relative@default.cps @@ -1,5 +1,4 @@ { - "cps_version": "0.13", "name": "Foo", "configuration": "default", "components": { -- cgit v0.12