summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-06-13 15:10:59 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2016-06-13 15:16:12 (GMT)
commit919db25c3b54f0303a19abb4a9e4f16056a3c1b6 (patch)
treeefac4b1898fa5fbe07a117fd8a20fce2284e5513 /Source/cmFindPackageCommand.cxx
parentebf18df58083c90d4ba06ab896dfad8df9fe6ade (diff)
downloadCMake-919db25c3b54f0303a19abb4a9e4f16056a3c1b6.zip
CMake-919db25c3b54f0303a19abb4a9e4f16056a3c1b6.tar.gz
CMake-919db25c3b54f0303a19abb4a9e4f16056a3c1b6.tar.bz2
cmFindPackageCommand: remove duplicate paths from error message
Fixes #15252.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 4ab7a72..1945c44 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -664,6 +664,8 @@ bool cmFindPackageCommand::HandlePackageMode()
// If there are files in ConsideredConfigs, it means that FooConfig.cmake
// have been found, but they didn't have appropriate versions.
else if (!this->ConsideredConfigs.empty()) {
+ std::vector<ConfigFileInfo>::const_iterator duplicate_end =
+ cmRemoveDuplicates(this->ConsideredConfigs);
e << "Could not find a configuration file for package \"" << this->Name
<< "\" that "
<< (this->VersionExact ? "exactly matches" : "is compatible with")
@@ -672,7 +674,7 @@ bool cmFindPackageCommand::HandlePackageMode()
"accepted:\n";
for (std::vector<ConfigFileInfo>::const_iterator i =
this->ConsideredConfigs.begin();
- i != this->ConsideredConfigs.end(); ++i) {
+ i != duplicate_end; ++i) {
e << " " << i->filename << ", version: " << i->version << "\n";
}
} else {