Просмотр исходного кода

Merge topic 'improve-cps-export-namespace-error' into release-4.1

86e647ef2a CPS: Improve invalid namespace error

Acked-by: Kitware Robot <[email protected]>
Merge-request: !11364
Brad King 1 месяц назад
Родитель
Сommit
48908f04f6

+ 2 - 1
Source/cmExportPackageInfoGenerator.cxx

@@ -305,7 +305,8 @@ bool cmExportPackageInfoGenerator::NoteLinkedTarget(
         cmStrCat("Target \"", target->GetName(), "\" references target \"",
                  linkedName, "\", which comes from the \"", pkgName,
                  "\" package, but does not belong to the package's "
-                 "canonical namespace. This is not allowed."));
+                 "canonical namespace (\"",
+                 prefix, "\"). This is not allowed."));
       return false;
     }
 

+ 3 - 3
Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt

@@ -1,4 +1,4 @@
-CMake Error in CMakeLists.txt:
+CMake Error in CMakeLists\.txt:
   Target "foo" references target "wrong::lib", which comes from the "broken"
-  package, but does not belong to the package's canonical namespace.  This is
-  not allowed.
+  package, but does not belong to the package's canonical namespace
+  \("broken::"\)\.  This is not allowed\.

+ 3 - 3
Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt

@@ -1,4 +1,4 @@
-CMake Error in CMakeLists.txt:
+CMake Error in CMakeLists\.txt:
   Target "foo" references target "wrong::lib", which comes from the "broken"
-  package, but does not belong to the package's canonical namespace.  This is
-  not allowed.
+  package, but does not belong to the package's canonical namespace
+  \("broken::"\)\.  This is not allowed\.