# \[graphviz\] How to generate dependency graph for larger monorepo projects when file names are too long?

**URL:** https://discourse.cmake.org/t/graphviz-how-to-generate-dependency-graph-for-larger-monorepo-projects-when-file-names-are-too-long/15455
**Category:** Usage
**Created:** [January 12, 2026, 11:18pm UTC](https://discourse.cmake.org/t/graphviz-how-to-generate-dependency-graph-for-larger-monorepo-projects-when-file-names-are-too-long/15455 "2026-01-12T23:18:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kratsg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kratsg/32/5975_2.png) [@kratsg](https://discourse.cmake.org/u/kratsg)
#### Post date: [January 12, 2026, 11:18pm UTC](https://discourse.cmake.org/t/graphviz-how-to-generate-dependency-graph-for-larger-monorepo-projects-when-file-names-are-too-long/15455/1 "2026-01-12T23:18:21Z")

</div>

We have a rather large CMake project for which we can configure/build just fine, but cannot generate `graphviz` for it due to the filenames being very long.

```auto
$ cmake -DATLAS_PACKAGE_FILTER_FILE=package_filters.txt -S columnar-athena/Projects/WorkDir -B build_graphviz --graphviz=/tmp/g.dot
...
Generate graphviz: /tmp/g.dot
CMake Error: Cannot open file for write: /tmp/g.dot.cvmfsatlas-nightlies.cern.chreposwmain_ColumnarAnalysis_x86_64-el9-gcc14-opt2026-01-10T2100ColumnarAnalysis25.2.49InstallAreax86_64-el9-gcc14-opt........AnalysisBaseExternals25.2.49InstallAreax86_64-el9-gcc14-optliblibROOTNTuple.so.dependers.tmp5ecc3

```

Can we configure or teach CMake to use a hash instead? If not, is there an alternative to being able to generate these dependency graphs?

---

<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: [February 9, 2026, 2:11am UTC](https://discourse.cmake.org/t/graphviz-how-to-generate-dependency-graph-for-larger-monorepo-projects-when-file-names-are-too-long/15455/2 "2026-02-09T02:11:20Z")

</div>

That is an…impressive target name. I think we can use hashes, but I’d also like to understand where this name comes from…

---

<div class="post-metadata">

### Author: ![kratsg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kratsg/32/5975_2.png) [@kratsg](https://discourse.cmake.org/u/kratsg)
#### Post date: [February 9, 2026, 4:54am UTC](https://discourse.cmake.org/t/graphviz-how-to-generate-dependency-graph-for-larger-monorepo-projects-when-file-names-are-too-long/15455/3 "2026-02-09T04:54:10Z")

</div>

Hi @ben.boeckel – luckily the reproducer exists as the codebase itself is public (and large): [atlas / athena · GitLab](https://gitlab.cern.ch/atlas/athena). The `package_filters.txt` is

```auto
+ (columnar-athena/)?PhysicsAnalysis/Columnar/ColumnarToolWrapperPython
- .*

```

You can do:

```auto
git clone https://gitlab.cern.ch/atlas/athena.git columnar-athena
cmake -DATLAS_PACKAGE_FILTER_FILE=package_filters.txt -S columnar-athena/Projects/WorkDir -B build_graphviz --graphviz=/tmp/g.dot

```

and let me know if you’re able to see the same. I don’t understand how the prefixes/target names are picked up, or how that’s generally configurable?

---

<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: [February 9, 2026, 4:01pm UTC](https://discourse.cmake.org/t/graphviz-how-to-generate-dependency-graph-for-larger-monorepo-projects-when-file-names-are-too-long/15455/4 "2026-02-09T16:01:54Z")

</div>

> [@kratsg](#):
>
> I don’t understand how the prefixes/target names are picked up, or how that’s generally configurable?

No, it seems to come from `cmLinkItem::AsStr()`.

Cc: @brad.king

---

<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: [February 28, 2026, 5:26am UTC](https://discourse.cmake.org/t/graphviz-how-to-generate-dependency-graph-for-larger-monorepo-projects-when-file-names-are-too-long/15455/5 "2026-02-28T05:26:10Z")

</div>

Can you please [file an issue](https://gitlab.kitware.com/cmake/cmake/-/issues/new) about this so it doesn’t get lost?

---

<div class="post-metadata">

### Author: ![kratsg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kratsg/32/5975_2.png) [@kratsg](https://discourse.cmake.org/u/kratsg)
#### Post date: [April 22, 2026, 1:13am UTC](https://discourse.cmake.org/t/graphviz-how-to-generate-dependency-graph-for-larger-monorepo-projects-when-file-names-are-too-long/15455/6 "2026-04-22T01:13:41Z")

</div>

[https://gitlab.kitware.com/cmake/cmake/-/work\_items/27764](https://gitlab.kitware.com/cmake/cmake/-/work_items/27764)
