Generator expressions support for BYPRODUCTS


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?

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. Some progress on that issue has been made within the last year. See this discussion in the issue for the current status.

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.