# Generation expression based on dependee?

**URL:** https://discourse.cmake.org/t/generation-expression-based-on-dependee/7220
**Category:** Usage
**Created:** [January 9, 2023, 7:56pm UTC](https://discourse.cmake.org/t/generation-expression-based-on-dependee/7220 "2023-01-09T19:56:10Z")
**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: [January 9, 2023, 10:59pm UTC](https://discourse.cmake.org/t/generation-expression-based-on-dependee/7220/2 "2023-01-09T22:59:38Z")

</div>

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:

```cmake
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 could “set” a property that changes what an “earlier” target would have done which, if followed, makes the “later” target not necessary: basically a way to say “this sentence is false”).

---

_[View the full topic](https://discourse.cmake.org/t/generation-expression-based-on-dependee/7220)._
