# Custom generator expressions

**URL:** https://discourse.cmake.org/t/custom-generator-expressions/15345
**Category:** Development
**Created:** [November 26, 2025, 1:00am UTC](https://discourse.cmake.org/t/custom-generator-expressions/15345 "2025-11-26T01:00:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Wallby](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/4491bb/32.png) [@Wallby](https://discourse.cmake.org/u/Wallby)
#### Post date: [November 26, 2025, 1:00am UTC](https://discourse.cmake.org/t/custom-generator-expressions/15345/1 "2025-11-26T01:00:58Z")

</div>

I was wondering whether there is any plan to introduce custom generator expressions. This would allow an inline equivalent to functions/macros. I don’t know if an equivalent of this feature already exists. I know that in Unix/GNU Make I used inline function calls a lot.

So something like the following (perhaps this syntax is not great, but I want to communicate the idea):

```auto
expression(MY_LIBRARY path)
set(RETURN "libraries/path")
return(RETURN)
endexpression()

add_library(Framework
    $<MY_LIBRARY:Framework,core/core.cpp # Full path becomes libraries/core/core.cpp
)

```

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [November 26, 2025, 9:14pm UTC](https://discourse.cmake.org/t/custom-generator-expressions/15345/2 "2025-11-26T21:14:51Z")

</div>

To my knowledge, there are no plans to offer custom generator expressions. I doubt that would be feasible, their implementation lives squarely in C++ land, and they are often on performance-sensitive code paths.

If you need to transform content in the project, that will have to be at configure time, not generation.
