Skip to content

Commit

Permalink
Handle GraphViz dot executable detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Hernán Morales Durand committed Mar 15, 2023
1 parent 17bbb8f commit c67676f
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,18 @@ add_third_party_dependencies_per_platform()
include(cmake/packaging.cmake)

# GraphViz Setup
include(cmake/CMakeGraphVizOptions.cmake)
if (BUILD_WITH_GRAPHVIZ)
add_custom_target(graphviz ALL
COMMENT "Build GraphViz Dependency Graph"
COMMAND cp ${CMAKE_SOURCE_DIR}/cmake/CMakeGraphVizOptions.cmake .
COMMAND ${CMAKE_COMMAND} "--graphviz=${GRAPHVIZ_GRAPH_NAME}.dot" .
COMMAND dot -Tpng ${GRAPHVIZ_GRAPH_NAME}.dot -o ${GRAPHVIZ_GRAPH_NAME}.png
)
endif()
find_program(DOT dot)
if (DOT)
include(cmake/CMakeGraphVizOptions.cmake)
if (BUILD_WITH_GRAPHVIZ)
add_custom_target(graphviz ALL
COMMENT "Build GraphViz Dependency Graph"
COMMAND cp ${CMAKE_SOURCE_DIR}/cmake/CMakeGraphVizOptions.cmake .
COMMAND ${CMAKE_COMMAND} "--graphviz=${GRAPHVIZ_GRAPH_NAME}.dot" .
COMMAND dot -Tpng ${GRAPHVIZ_GRAPH_NAME}.dot -o ${GRAPHVIZ_GRAPH_NAME}.png
)
endif()
else()
MESSAGE(STATUS "dot executable from Graphviz not found. Dependency graphs not generated")
endif (DOT)

0 comments on commit c67676f

Please sign in to comment.