graphviz option generate non valid dot files when no CMakeGraphVizOptions.cmake is present.
Version of cmake: 3.9.2
This feature used to work fine for my project, but I have not used it in quite a number of cmake versions (5 or 6 at least), and when calling it like so, without a CMakeGraphVizOptions.cmake:
cmake --graphviz=deps.dot .
dot -Tpdf -o deps.pdf deps.dot
I get:
Error: deps.dot: syntax error in line 2 near 'fontsize'
And sure enough the file contains (note the line breaks, indentation and most importantly the syntax error: the "n" character in the node):
digraph "GG" {
node [n fontsize = "20"]; rankdir="LR";
"node21" [ label="f2c" shape="polygon"];;
[...]
Also, note that no dot file per target is generated
Whereas, even with an empty CMakeGraphVizOptions.cmake file in the build (I haven't tried in the source, but that is irrelevant I guess), the output for the header is (note that even the line breaks are different):
digraph "GG" {
node [
fontsize = "12"
];
"node21" [ label="f2c" shape="polygon"];
[...]
And in that case the default of generating a dot file per target is respected, the dot files are valid.
Also: thank you for developing and maintaining cmake, great tool.