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

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.

$ 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?

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

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

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

You can do:

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?

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

Cc: @brad.king