# Cmake build error hook

**URL:** https://discourse.cmake.org/t/cmake-build-error-hook/3634
**Category:** Code
**Created:** [June 27, 2021, 8:05am UTC](https://discourse.cmake.org/t/cmake-build-error-hook/3634 "2021-06-27T08:05:54Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [June 27, 2021, 12:51pm UTC](https://discourse.cmake.org/t/cmake-build-error-hook/3634/2 "2021-06-27T12:51:51Z")

</div>

Build tools don’t provide such functionality generally, so CMake can’t provide any such guarantees. One could _maybe_ hook it up with GNU make, but I don’t know if that’s possible.

The solution is to either use `file(GLOB CONFIGURE_DEPENDS)`, but I recommend against `file(GLOB)` for source listing in [that situation as well](https://discourse.cmake.org/t/is-glob-still-considered-harmful-with-configure-depends/808/2).

---

_[View the full topic](https://discourse.cmake.org/t/cmake-build-error-hook/3634)._
