# add\_custom\_command() POST\_BUILD generator expression expansion not working

**URL:** <https://discourse.cmake.org/t/add-custom-command-post-build-generator-expression-expansion-not-working/3244>\
**Category:** Code\
**Tags:** gen:ninja\
**Created:** [May 1, 2021, 7:51pm UTC](https://discourse.cmake.org/t/add-custom-command-post-build-generator-expression-expansion-not-working/3244 "2021-05-01T19:51:42Z")\
**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:** [May 2, 2021, 10:40am UTC](https://discourse.cmake.org/t/add-custom-command-post-build-generator-expression-expansion-not-working/3244/2 "2021-05-02T10:40:11Z")

</div>

Spaces generally aren’t well-formed inside of genexes. You’ll need to replace the spaces with `;` to make it parse properly (which is why you’re seeing half-expanded remnants in the build command).

---

_[View the full topic](https://discourse.cmake.org/t/add-custom-command-post-build-generator-expression-expansion-not-working/3244)._
