# collect source lists

**URL:** https://discourse.cmake.org/t/collect-source-lists/15459
**Category:** Code
**Created:** [January 14, 2026, 11:30pm UTC](https://discourse.cmake.org/t/collect-source-lists/15459 "2026-01-14T23:30:33Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [February 9, 2026, 2:14am UTC](https://discourse.cmake.org/t/collect-source-lists/15459/4 "2026-02-09T02:14:20Z")

</div>

For more background, see:

> [@Add GLOBBING support to target\_sources?](https://discourse.cmake.org/t/add-globbing-support-to-target-sources/3749):
>
> Currently here are 2 common patterns in our CMake codebase. Since we really like the safe globbing functionality added in 3.13. What is already possible # SAFE GLOBBING! :D file(GLOB\_RECURSE sources CONFIGURE\_DEPENDS \*.cpp \*.h) target\_sources(foobar PRIVATE ${sources}) # or # SAFE GLOBBING! :D file(GLOB sources CONFIGURE\_DEPENDS \*.cpp \*.h) target\_sources(foobar PRIVATE ${sources}) Proposal I think it would be great to add this support inside target\_sources # To get recursive behavior specif…

> [@Is GLOB still considered harmful with CONFIGURE\_DEPENDS?](https://discourse.cmake.org/t/is-glob-still-considered-harmful-with-configure-depends/808/2):
>
> The check costs depend on the platform (and probably generator too). I don’t know of the performance costs, but that’s because I personally find that even if it were performant, there’s at least one issue that I run into often enough to make it not worth it. I still highly discourage globbing for the reason that files may appear in your source tree that you do not intend to build. The main case I’ve run into is that during conflict resolution in git, the other versions of the file(s) in conflic…

---

_[View the full topic](https://discourse.cmake.org/t/collect-source-lists/15459)._
