# Detecting scope of added sources

**URL:** https://discourse.cmake.org/t/detecting-scope-of-added-sources/8634
**Category:** Code
**Created:** [July 29, 2023, 6:07pm UTC](https://discourse.cmake.org/t/detecting-scope-of-added-sources/8634 "2023-07-29T18:07:28Z")
**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: [July 29, 2023, 8:54pm UTC](https://discourse.cmake.org/t/detecting-scope-of-added-sources/8634/2 "2023-07-29T20:54:20Z")

</div>

It’s not possible and will not be supported. See this post:

> [@Generation expression based on dependee?](https://discourse.cmake.org/t/generation-expression-based-on-dependee/7220/2):
>
> This is what I call “intersectional usage requirements” (or “I use A and B therefore C” kind of logic). CMake doesn’t have support for this. What you can do is something like: target\_link\_libraries(input INTERFACE "$\<$\<BOOL:$\<TARGET\_PROPERTY:USES\_MOUSE\>\>:widgets\>") add\_executable(app) target\_link\_libraries(app PUBLIC input mouse) set\_property(TARGET app PROPERTY USES\_MOUSE 1) There’s also no support for $\<INHERITED\_PROPERTY\> because it can cause undecidable builds (a “later” target coul…

---

_[View the full topic](https://discourse.cmake.org/t/detecting-scope-of-added-sources/8634)._
