By using CMake you can automatically generate dependency graphs (dot/graphviz) of the targets in your project. This works for dependencies within the project, as well as dependencies to external libraries.
To use it, run cmake in the build tree:
cmake --graphviz=test.dot .
The resulting graphs can be huge. The look and content of the generated graphs can be controlled using the file CMakeGraphVizOptions.cmake
. This file is first searched in CMAKE_BINARY_DIR
, and then in CMAKE_SOURCE_DIR
. If found, the variables set in it are used to adjust options for the generated Graphviz files.
dot -Tpng test.dot -o foo.png