Explorar o código

Merge topic 'cps-fix-extra-schema' into release-4.0

83b22da7ac cmPackageInfoReader: Inherit cps_version
caff0d62c6 cmFindPackageCommand: Simplify cmStrCat

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !10329
Brad King hai 8 meses
pai
achega
4977e98594

+ 1 - 1
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))) {
 

+ 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": {