# How to prevent clang-tidy to check sources added with FetchContents?

**URL:** https://discourse.cmake.org/t/how-to-prevent-clang-tidy-to-check-sources-added-with-fetchcontents/2871
**Category:** Code
**Created:** [March 2, 2021, 6:26pm UTC](https://discourse.cmake.org/t/how-to-prevent-clang-tidy-to-check-sources-added-with-fetchcontents/2871 "2021-03-02T18:26:09Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [March 2, 2021, 6:26pm UTC](https://discourse.cmake.org/t/how-to-prevent-clang-tidy-to-check-sources-added-with-fetchcontents/2871/2 "2021-03-02T18:26:57Z")

</div>

### This fix it temporarily:

```bash
perl -i.bak -pe 's#-I($CPM_SOURCE_CACHE)#-isystem $1#g' build/install/compile_commands.json
run-clang-tidy.py -p build/install source
# . . .
# no warnings

```

---

_[View the full topic](https://discourse.cmake.org/t/how-to-prevent-clang-tidy-to-check-sources-added-with-fetchcontents/2871)._
