CMake dependency graph for custom targets
The CMake manual clearly states:
--graphviz=[file]
Generate a graphviz input file that will contain all the library and executable dependencies in the project. See the documentation for CMakeGraphVizOptions.cmake for more details.
So, as far as I know, your custom target is neither - nor library, nor executable to be included into the resulting graph.
As some might stumble over this question.
With CMake 3.17 custom targets can now be included
https://cmake.org/cmake/help/v3.17/module/CMakeGraphVizOptions.html (related issue 17960)
GRAPHVIZ_CUSTOM_TARGETS
Set to TRUE to include custom targets in the generated graphs.
Mandatory: NO
Default: FALSEGRAPHVIZ_IGNORE_TARGETS
A list of regular expressions for names of targets to exclude from the generated graphs.
Mandatory: NO
Default: empty