# enumerating and keeping up to date the list of sources

**URL:** https://discourse.cmake.org/t/enumerating-and-keeping-up-to-date-the-list-of-sources/2900
**Category:** Usage
**Created:** [March 5, 2021, 5:25pm UTC](https://discourse.cmake.org/t/enumerating-and-keeping-up-to-date-the-list-of-sources/2900 "2021-03-05T17:25:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)
#### Post date: [March 5, 2021, 5:25pm UTC](https://discourse.cmake.org/t/enumerating-and-keeping-up-to-date-the-list-of-sources/2900/1 "2021-03-05T17:25:31Z")

</div>

Hi,

It is common wisdom that file(glob) is not the proper way to collect and maintain the list of sources of a project as, when adding a new file, cmake will not detect the modification and will not regenerate.  
But I fail to find on the net (and on the forum) what would be the correct solution.

Thanks

---

<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: [March 5, 2021, 9:59pm UTC](https://discourse.cmake.org/t/enumerating-and-keeping-up-to-date-the-list-of-sources/2900/2 "2021-03-05T21:59:59Z")

</div>

The correct solution is just to explicitly list your source files. This way you know exactly what is in a given build.

See [this thread](https://discourse.cmake.org/t/is-glob-still-considered-harmful-with-configure-depends/808) for more.

---

<div class="post-metadata">

### Author: ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)
#### Post date: [March 8, 2021, 11:10am UTC](https://discourse.cmake.org/t/enumerating-and-keeping-up-to-date-the-list-of-sources/2900/3 "2021-03-08T11:10:31Z")

</div>

Hi,

OK, the lack of automation is disappointing but the argument answer the question (so I mark as solved)

regards.
