mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-13 12:59:55 -05:00
Graphviz: Fix bug that shows duplicated alias targets
When using subdirectories the alias targets were duplicated
This commit is contained in:
committed by
Stephan Rohmen
parent
35d8543f25
commit
f7dd74e4ef
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user