[CMake] Graphviz support in CMake

Filipe Sousa filipe at ipb.pt
Wed Mar 8 09:19:23 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andy Cedilnik wrote:
> Hello,
> 
> I got tired of tracing dependencies between libraries by hand, so I 
> added support in CMake to dump out a graphviz file of all dependencies 
> between libraries. Example can be seen here:
> 
> http://www.cmake.org/Wiki/CMake:For_CMake_Hackers
> 
> To use it, run cmake in the build tree:
> 
> cmake --graphviz=test.dot .

Please, add it to cmake --help

> Ok, current issues:
> 1. If you have too many targets (like VTK, ITK, and pretty much anything 
> else) you will not see anything
> 2. All things are same color, so no way to differentiate
> 3. No differentiation between full path to the library and library itself
> 4. Layout could be improved

Another problem I see is with TARGET_LINK_LIBRARIES(target debug
debug_lib optimized opt_lib). Only one of the libraries is used but both
appear in graphviz (See PndK.dot)

> Look at it and give me suggestions.

Instead of cmake --graphviz=test.dot . wouldn't be better make graphviz,
the name of the output file would be the name of the project.


- --
Filipe Sousa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFEDufqbQdNYqwwwCwRAgwXAJ9QIVtErmavJbLHuvG8wV84S//4ggCeK/JP
5578Qzg1JQ0iRNNl26F0CPw=
=aNtO
-----END PGP SIGNATURE-----
-------------- next part --------------
digraph GG {
node [
  fontsize = "12"
];
    "node13" [ label="/usr/local/Trolltech/Qt-4.1.1/lib/libQtCore.so" shape="ellipse"];
    "node12" [ label="/usr/local/Trolltech/Qt-4.1.1/lib/libQtCore_debug.so" shape="ellipse"];
    "node11" [ label="/usr/local/Trolltech/Qt-4.1.1/lib/libQtGui.so" shape="ellipse"];
    "node10" [ label="/usr/local/Trolltech/Qt-4.1.1/lib/libQtGui_debug.so" shape="ellipse"];
    "node15" [ label="/usr/local/Trolltech/Qt-4.1.1/lib/libQtXml.so" shape="ellipse"];
    "node14" [ label="/usr/local/Trolltech/Qt-4.1.1/lib/libQtXml_debug.so" shape="ellipse"];
    "node2" [ label="PndK" shape="house"];
    "node0" [ label="QtCanvas" shape="diamond"];
    "node1" [ label="properties" shape="diamond"];
    "node0" -> "node10"
    "node0" -> "node11"
    "node0" -> "node12"
    "node0" -> "node13"
    "node1" -> "node10"
    "node1" -> "node11"
    "node1" -> "node12"
    "node1" -> "node13"
    "node2" -> "node10"
    "node2" -> "node11"
    "node2" -> "node14"
    "node2" -> "node15"
    "node2" -> "node12"
    "node2" -> "node13"
    "node2" -> "node1"
    "node2" -> "node0"
}


More information about the CMake mailing list