# Generator expressions support for BYPRODUCTS

**URL:** https://discourse.cmake.org/t/generator-expressions-support-for-byproducts/1124
**Category:** Development
**Created:** [April 30, 2020, 2:48pm UTC](https://discourse.cmake.org/t/generator-expressions-support-for-byproducts/1124 "2020-04-30T14:48:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)
#### Post date: [April 30, 2020, 2:48pm UTC](https://discourse.cmake.org/t/generator-expressions-support-for-byproducts/1124/1 "2020-04-30T14:48:45Z")

</div>

Hi,

I can add a custom POST\_BUILD command using generator expressions for the additional filename just fine. However, for Ninja to notice, I’d have to use BYPRODUCTS argument in the add\_custom\_command.

It is confusing that this does not understand generator expressions in this case. Why?

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [April 30, 2020, 2:59pm UTC](https://discourse.cmake.org/t/generator-expressions-support-for-byproducts/1124/2 "2020-04-30T14:59:14Z")

</div>

Generator expressions are not supported in custom command `OUTPUTS` or `BYPRODUCTS` (which are outputs that do not have to be newer than inputs). See [CMake Issue12877](https://gitlab.kitware.com/cmake/cmake/-/issues/12877). Some progress on that issue has been made within the last year. See [this discussion](https://gitlab.kitware.com/cmake/cmake/-/issues/12877#note_664330) in the issue for the current status.

---

<div class="post-metadata">

### Author: ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)
#### Post date: [April 30, 2020, 9:44pm UTC](https://discourse.cmake.org/t/generator-expressions-support-for-byproducts/1124/3 "2020-04-30T21:44:13Z")

</div>

This sounds like a lot of work. Actually I only needed it for stripping debug symbols. Having it set as BYPRODUCT is just cleaner but not technically necessary. Thanks.
