diff --git a/Source/cmExportPackageInfoGenerator.cxx b/Source/cmExportPackageInfoGenerator.cxx index 47195306ee..d82f45bf6a 100644 --- a/Source/cmExportPackageInfoGenerator.cxx +++ b/Source/cmExportPackageInfoGenerator.cxx @@ -330,7 +330,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; } diff --git a/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt index 0f3a85ffb7..74f771c215 100644 --- a/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt +++ b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt @@ -1,4 +1,4 @@ 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\. diff --git a/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt index 0f3a85ffb7..74f771c215 100644 --- a/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt +++ b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt @@ -1,4 +1,4 @@ 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\.