graphviz

i add it on my last code, but I can’ t see any png on my build folder.

add_custom_target(graphviz ALL
    COMMAND ${CMAKE_COMMAND} "--graphviz=${PROJECT_NAME}.dot" .
    COMMAND dot -Tpng ${PROJECT_NAME}.dot -o ${PROJECT_NAME}.png
    WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)

or other recommand program graph ?
I want to use the graph to understand the cmake command (target_include_directories 、 target_link_libraries 、 PUBLICE 、 PRIVATE)
like this

I tried your code, and it worked fine for me. Note that your code is set up such that it will trigger the CMake run at build time. Did you actually build the graphviz target?

how do you install and add the path to exe on win?

how to use these

If it has a example and command, it will be great

set(GRAPHVIZ_GRAPH_TYPE digraph)
set(GRAPHVIZ_GRAPH_NAME FairRoot)
set(GRAPHVIZ_EXECUTABLES OFF)
set(GRAPHVIZ_STATIC_LIBS OFF)
set(GRAPHVIZ_SHARED_LIBS ON)
set(GRAPHVIZ_MODULE_LIBS OFF)
set(GRAPHVIZ_GENERATE_PER_TARGET OFF)
set(GRAPHVIZ_GENERATE_DEPENDERS OFF)