Skip to content

Files

Latest commit

 

History

History

cmake

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Generating Dependency Graphs with CMake

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.

dbscan-dependencies

Usage

To use it, run cmake in the build tree:

cmake --graphviz=test.dot .

Variables specific to the Graphviz support

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.

Graphviz (.dot) file to .png

dot -Tpng test.dot -o foo.png

Reference