When you add --graphviz=graph/X.dot
to the cmake command, it will generate some .dot files based on the dependencies you have.
For unix based systems, you can use the following python code to generate svg for each dot file:
import os
# read all .dot files in a path