# Add GLOBBING support to target\_sources?

**URL:** https://discourse.cmake.org/t/add-globbing-support-to-target-sources/3749
**Category:** Development
**Created:** [July 13, 2021, 10:17pm UTC](https://discourse.cmake.org/t/add-globbing-support-to-target-sources/3749 "2021-07-13T22:17:47Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![alex](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alex/32/125_2.png) [@alex](https://discourse.cmake.org/u/alex)
#### Post date: [July 14, 2021, 6:14am UTC](https://discourse.cmake.org/t/add-globbing-support-to-target-sources/3749/3 "2021-07-14T06:14:08Z")

</div>

There is one material difference to this form of proposal [which I have noted elsewhere](https://discourse.cmake.org/t/is-glob-still-considered-harmful-with-configure-depends/808/15) and which we briefly discussed… making glob expressions _opaque_ (i.e. a special part of the `SOURCES` property or a `$<GLOB:...>` genex whose result cannot be inspected by the configure step) would, _in theory_, allow CMake to resume from the generation step and regenerate only the part of the build system affected by the genex. This would lead to faster regeneration than _either_ the existing explicit file lists _or_ `CONFIGURE_DEPENDS`-style globbing.

Since the key constraint here is _opacity_ from the rest of the configure step, an interesting alternative could be to add a `$<SOURCE_LIST:..>` genex which loads sources from a file with a newline-delimited list of sources (or json or whatever, no need to bikeshed). Then when you add a source to the list, it could do a fast regeneration without fully reconfiguring.

---

_[View the full topic](https://discourse.cmake.org/t/add-globbing-support-to-target-sources/3749)._
