Difference between revisions of "Dependency Graphs"

From GnuCash
Jump to: navigation, search
(Wiki page documenting how to generate dependency graphs.)
 
(dot options (from IRC))
Line 10: Line 10:
 
dot graph -Tsvg -o graph.svg
 
dot graph -Tsvg -o graph.svg
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
;dot options: -Grankdir=LR for horizontal layout,
 +
: -Tpng to get a png.
 
This will result in lots of files in the graphviz directory. The one we're interested in is '''graph.svg'''.
 
This will result in lots of files in the graphviz directory. The one we're interested in is '''graph.svg'''.
  
 
Below you'll find two examples.
 
Below you'll find two examples.

Revision as of 18:08, 8 December 2019

GnuCash is a complex project. To keep some structure in the code, the source files are grouped into targets. Higher level targets can depend on lower level targets. That means, the lower level targets must be built before the higher level target can be built. Given the complexity, it may be challenging to get a view of these dependencies.

Luckily cmake (our build system generation tool) has built-in support for the graphviz dependency visualization tool.

To use it you can use these commands:

mkdir graphviz && cd graphviz
cmake --graphviz=graph ..
dot graph -Tsvg -o graph.svg
dot options
-Grankdir=LR for horizontal layout,
-Tpng to get a png.

This will result in lots of files in the graphviz directory. The one we're interested in is graph.svg.

Below you'll find two examples.