Skip to content

Commit

Permalink
Target to generate graph (#947)
Browse files Browse the repository at this point in the history
Add a "graphviz" target to generate dot, png and svg files representing
CMake dependency graph.
  • Loading branch information
JasonMarechal25 authored Oct 30, 2024
1 parent ed1ac1a commit 48e1474
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeGraphVizOptions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(GRAPHVIZ_GENERATE_PER_TARGET FALSE)
set(GRAPHVIZ_IGNORE_TARGETS ".*test.*")
set(GRAPHVIZ_EXTERNAL_LIBS FALSE)
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,3 +407,10 @@ endif ()
#version file to define Xpansion and Antares-simulator versions
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/python/antares_xpansion/__version__.py.in ${CMAKE_CURRENT_SOURCE_DIR}/src/python/antares_xpansion/__version__.py)
include(CPack)

add_custom_target(graphviz
COMMAND ${CMAKE_COMMAND} "--graphviz=xpansion.dot" .
COMMAND dot -Tsvg xpansion.dot -o xpansion.svg
COMMAND dot -Tpng xpansion.dot -o xpansion.png
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)

0 comments on commit 48e1474

Please sign in to comment.