custom targets not shown in my dependency graph


All my custom targets are missing in the graphviz dependency graph. The build has an executable that is dependent on them!

How can I generate a dependency graph for custom targets?

add_executable( dummyExe ${CMAKE_CURRENT_BINARY_DIR}/main )
add_custom_target( tgt1 )
add_dependencies( dummyExe tgt1 )

a graphviz input file that will contain all the library and executable dependencies in the project

how do I read this? The graph only creates dependencies for targets of type EXECUTABLE?

Which kind of dependencies? It doesn’t seem to work when using add_dependencies. Does it only work for file level dependencies?

add_executable( dummyExe ${CMAKE_CURRENT_BINARY_DIR}/main )
add_library( dummyLib ${CMAKE_CURRENT_BINARY_DIR}/lib )
add_dependencies( dummyExe dummyLib )

Support for this was added only a few months ago and should be available in the CMake 3.17.0-rc1 release candidate that came out today. This comment in the relevant issue notes the following:

I have implemented proper support for custom targets in MR 3766.

It is disabled by default (controlled through GRAPHVIZ_CUSTOM_TARGETS ) because it tends to be noisy and people might generally want to combine it with GRAPHVIZ_IGNORE_TARGETS .