Graphviz: Fix bug that shows duplicated alias targets
When using subdirectories the alias targets were duplicated
This commit is contained in:
parent
35d8543f25
commit
f7dd74e4ef
@ -2,6 +2,7 @@
|
|||||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||||
#include "cmGraphVizWriter.h"
|
#include "cmGraphVizWriter.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -552,16 +553,23 @@ bool cmGraphVizWriter::TargetTypeEnabled(
|
|||||||
std::string cmGraphVizWriter::ItemNameWithAliases(
|
std::string cmGraphVizWriter::ItemNameWithAliases(
|
||||||
std::string const& itemName) const
|
std::string const& itemName) const
|
||||||
{
|
{
|
||||||
auto nameWithAliases = itemName;
|
std::vector<std::string> items;
|
||||||
|
|
||||||
for (auto const& lg : this->GlobalGenerator->GetLocalGenerators()) {
|
for (auto const& lg : this->GlobalGenerator->GetLocalGenerators()) {
|
||||||
for (auto const& aliasTargets : lg->GetMakefile()->GetAliasTargets()) {
|
for (auto const& aliasTargets : lg->GetMakefile()->GetAliasTargets()) {
|
||||||
if (aliasTargets.second == itemName) {
|
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;
|
return nameWithAliases;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,3 +64,5 @@ target_link_libraries(ConsoleApplication CryptoCurrencyMiningLibrary)
|
|||||||
|
|
||||||
add_custom_target(GenerateManPage COMMAND ${CMAKE_COMMAND} --version)
|
add_custom_target(GenerateManPage COMMAND ${CMAKE_COMMAND} --version)
|
||||||
add_dependencies(ConsoleApplication GenerateManPage)
|
add_dependencies(ConsoleApplication GenerateManPage)
|
||||||
|
|
||||||
|
add_subdirectory(sub_directory_target)
|
||||||
|
@ -52,4 +52,5 @@ subgraph clusterLegend {
|
|||||||
"node12" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node12" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node12" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node12" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node12" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node12" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node13" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,5 @@ subgraph clusterLegend {
|
|||||||
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node12" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,5 @@ subgraph clusterLegend {
|
|||||||
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node12" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -46,4 +46,5 @@ subgraph clusterLegend {
|
|||||||
"node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node10" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -35,4 +35,5 @@ subgraph clusterLegend {
|
|||||||
"node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
|
"node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
|
||||||
"node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
|
"node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
|
||||||
"node6" [ label = "\"-lm\"", shape = septagon ];
|
"node6" [ label = "\"-lm\"", shape = septagon ];
|
||||||
|
"node7" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -43,4 +43,5 @@ subgraph clusterLegend {
|
|||||||
"node8" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
|
"node8" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
|
||||||
"node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node9" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node9" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node10" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -44,4 +44,5 @@ subgraph clusterLegend {
|
|||||||
"node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
|
"node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
|
||||||
"node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
|
"node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
|
||||||
"node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
|
"node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
|
||||||
|
"node10" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,5 @@ subgraph clusterLegend {
|
|||||||
"node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node11" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,5 @@ subgraph clusterLegend {
|
|||||||
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node12" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -44,4 +44,5 @@ subgraph clusterLegend {
|
|||||||
"node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node11" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -39,4 +39,5 @@ subgraph clusterLegend {
|
|||||||
"node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
|
"node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
|
||||||
"node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
|
"node10" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,5 @@ subgraph clusterLegend {
|
|||||||
"node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node11" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,5 @@ subgraph clusterLegend {
|
|||||||
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node12" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,5 @@ subgraph clusterLegend {
|
|||||||
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"node12" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,5 @@ subgraph clusterLegend {
|
|||||||
"point11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
"point11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
|
||||||
"point11" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
"point11" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
|
||||||
"point11" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
"point11" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
|
||||||
|
"point12" [ label = "SubDirectoryTarget", shape = egg ];
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
add_executable(SubDirectoryTarget test.c)
|
4
Tests/RunCMake/Graphviz/sub_directory_target/test.c
Normal file
4
Tests/RunCMake/Graphviz/sub_directory_target/test.c
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user