diff options
Diffstat (limited to 'Source/cmGraphVizWriter.cxx')
-rw-r--r-- | Source/cmGraphVizWriter.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 570f4ea..8a7728e 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGraphVizWriter.h" +#include <algorithm> #include <cctype> #include <iostream> #include <memory> @@ -552,16 +553,23 @@ bool cmGraphVizWriter::TargetTypeEnabled( std::string cmGraphVizWriter::ItemNameWithAliases( std::string const& itemName) const { - auto nameWithAliases = itemName; - + std::vector<std::string> items; for (auto const& lg : this->GlobalGenerator->GetLocalGenerators()) { for (auto const& aliasTargets : lg->GetMakefile()->GetAliasTargets()) { if (aliasTargets.second == itemName) { - nameWithAliases += "\\n(" + aliasTargets.first + ")"; + items.push_back(aliasTargets.first); } } } + std::sort(items.begin(), items.end()); + items.erase(std::unique(items.begin(), items.end()), items.end()); + + auto nameWithAliases = itemName; + for(auto const& item : items) { + nameWithAliases += "\\n(" + item + ")"; + } + return nameWithAliases; } |