# clang-format integration

**URL:** https://discourse.cmake.org/t/clang-format-integration/3358
**Category:** Code
**Tags:** comp:clang
**Created:** [May 18, 2021, 7:44am UTC](https://discourse.cmake.org/t/clang-format-integration/3358 "2021-05-18T07:44:43Z")
**Posts on this page:** 1
**Showing post:** 8

<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: [May 19, 2021, 1:59pm UTC](https://discourse.cmake.org/t/clang-format-integration/3358/8 "2021-05-19T13:59:58Z")

</div>

One can iterate over the `SOURCES` for each target. I would recommend explicit target enumeration, but you can iterate through the `SUBDIRECTORIES` directory property for the top-level directory to read `BUILDSYSTEM_TARGETS` for each directory instead.

---

_[View the full topic](https://discourse.cmake.org/t/clang-format-integration/3358)._
