# How to limit depth of generated .dot files with --graphviz option

**URL:** https://discourse.cmake.org/t/how-to-limit-depth-of-generated-dot-files-with-graphviz-option/4621
**Category:** Usage
**Created:** [December 8, 2021, 4:37am UTC](https://discourse.cmake.org/t/how-to-limit-depth-of-generated-dot-files-with-graphviz-option/4621 "2021-12-08T04:37:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ian.gralinski.inv](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/i/e5b9ba/32.png) [@ian.gralinski.inv](https://discourse.cmake.org/u/ian.gralinski.inv)
#### Post date: [December 8, 2021, 4:37am UTC](https://discourse.cmake.org/t/how-to-limit-depth-of-generated-dot-files-with-graphviz-option/4621/1 "2021-12-08T04:37:22Z")

</div>

Is there a way to specify a maximum depth of graphs when creating graphviz output?

Something like `cmake --graphviz=graph.dot --max-depth=5` that would only output nodes that are a maximum of 5 edges away?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 11, 2021, 7:15pm UTC](https://discourse.cmake.org/t/how-to-limit-depth-of-generated-dot-files-with-graphviz-option/4621/2 "2021-12-11T19:15:32Z")

</div>

I don’t think so. A [feature request](https://gitlab.kitware.com/cmake/cmake/-/issues) would be the way to go I think.

---

<div class="post-metadata">

### Author: ![ian.gralinski.inv](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/i/e5b9ba/32.png) [@ian.gralinski.inv](https://discourse.cmake.org/u/ian.gralinski.inv)
#### Post date: [December 16, 2021, 2:53am UTC](https://discourse.cmake.org/t/how-to-limit-depth-of-generated-dot-files-with-graphviz-option/4621/3 "2021-12-16T02:53:47Z")

</div>

Thanks, created a feature request for this: [https://gitlab.kitware.com/cmake/cmake/-/issues/23020](https://gitlab.kitware.com/cmake/cmake/-/issues/23020)
