The builtin graphviz support of CMake.
CMake can generate graphviz files, showing the dependencies between the targets in a project and also external libraries which are linked against. When CMake is run with the --graphviz=foo.dot
option, it will produce:
foo.dot
file showing all dependencies in the projectfoo.dot.<target>
file for each target, file showing on which other targets the respective target dependsfoo.dot.<target>.dependers
file, showing which other targets depend on the respective targetThe different dependency types PUBLIC
, PRIVATE
and INTERFACE
are represented as solid, dashed and dotted edges.
This can result in huge graphs. Using the file CMakeGraphVizOptions.cmake
the look and content of the generated graphs can be influenced. This file is searched first in CMAKE_BINARY_DIR
and then in CMAKE_SOURCE_DIR
. If found, it is read and the variables set in it are used to adjust options for the generated graphviz files.
GRAPHVIZ_GRAPH_TYPE
The graph type.
Valid graph types are:
GRAPHVIZ_GRAPH_NAME
The graph name.
GRAPHVIZ_GRAPH_HEADER
The header written at the top of the graphviz file.
GRAPHVIZ_NODE_PREFIX
The prefix for each node in the graphviz file.
GRAPHVIZ_EXECUTABLES
Set this to FALSE to exclude executables from the generated graphs.
GRAPHVIZ_STATIC_LIBS
Set this to FALSE to exclude static libraries from the generated graphs.
GRAPHVIZ_SHARED_LIBS
Set this to FALSE to exclude shared libraries from the generated graphs.
GRAPHVIZ_MODULE_LIBS
Set this to FALSE to exclude module libraries from the generated graphs.
GRAPHVIZ_EXTERNAL_LIBS
Set this to FALSE to exclude external libraries from the generated graphs.
GRAPHVIZ_IGNORE_TARGETS
A list of regular expressions for ignoring targets.
GRAPHVIZ_GENERATE_PER_TARGET
Set this to FALSE to exclude per target graphs foo.dot.<target>
.
GRAPHVIZ_GENERATE_DEPENDERS
Set this to FALSE to exclude depender graphs foo.dot.<target>.dependers
.
© 2000–2018 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.12/module/CMakeGraphVizOptions.html