From caff0d62c6b7bc88a68ee3528a251d764359b9eb Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Tue, 11 Feb 2025 12:29:06 -0500 Subject: cmFindPackageCommand: Simplify cmStrCat Replace an unnecessary single-character string_view in cmStrCat with a literal character. --- Source/cmFindPackageCommand.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index cd1938e..63a313c 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -2022,7 +2022,7 @@ bool cmFindPackageCommand::ImportPackageTargets(std::string const& fileName, cmsys::Glob glob; glob.RecurseOff(); if (glob.FindFiles( - cmStrCat(cmSystemTools::GetFilenamePath(fileName), "/"_s, + cmStrCat(cmSystemTools::GetFilenamePath(fileName), '/', cmSystemTools::GetFilenameWithoutExtension(fileName), "@*.[Cc][Pp][Ss]"_s))) { -- cgit v0.12 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