Skip to content

Commit 45cae98

Browse files
committed
make graphviz optional
1 parent 62d4be7 commit 45cae98

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

CMakeGraphVizOptions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
set(GRAPHVIZ_GENERATE_PER_TARGET TRUE)
2-
set(GRAPHVIZ_IGNORE_TARGETS test_* unity)
2+
set(GRAPHVIZ_IGNORE_TARGETS test_* unity gcov)

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ option(BUILD_TESTING "Enable building unit tests" OFF)
2929
option(TEST_MEMCHECK "Enable test runtime memory checking" OFF)
3030
option(TEST_COVERAGE "Enable test runtime coverage logging" OFF)
3131
option(BUILD_PACKAGE "Enable building package outputs" OFF)
32+
option(GENERATE_GRAPHVIZ "Generate a dependency graph via Graphviz" OFF)
3233

3334
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
3435

@@ -199,8 +200,10 @@ if(BUILD_PACKAGE)
199200
add_subdirectory(pkg)
200201
endif(BUILD_PACKAGE)
201202

202-
add_custom_target(graphviz ALL
203-
COMMAND ${CMAKE_COMMAND} "--graphviz=dep_chart.dot" .
204-
COMMAND dot -Tpng dep_chart.dot -o dep_chart.png
205-
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
206-
)
203+
if(GENERATE_GRAPHVIZ)
204+
add_custom_target(graphviz ALL
205+
COMMAND ${CMAKE_COMMAND} "--graphviz=dep_chart.dot" .
206+
COMMAND dot -Tpng dep_chart.dot -o dep_chart.png
207+
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
208+
)
209+
endif(GENERATE_GRAPHVIZ)

0 commit comments

Comments
 (0)