list of commands supporting generator expressions

set() supports generator expressions but this is not mentioned in the official doc to this command.

I’ve been told using generator expressions in set() is agnostic.

Is there a compulsory and complete list of commands supporting generator expressions?

What do you mean by “support”? set() won’t expand generator expressions, but it can certainly store their unexpanded forms (the $<> syntax) as normal text.


refers to the fact of not mentioning the ability of generator expressions in the official doc of set()
while on other commands like target_compile_definitions() the ability to use generator expressions is mentioned explicitly.

One reason not to explicitly state the ability for set(), I didn’t know, is your explanation.

Would be nice to clarify my second question about the list of commands able to receive generator expressions as arguments.

All of them accept genexes as arguments. The difference is in what commands end up plumbing them through to a place which expands them in a useful location.

Some commands only support them in different modes, different signatures, or within specific arguments. For example add_test(TestName) does not support them at all while add_test(NAME TestName) does. And add_custom_command didn’t support it in OUTPUT argument values until 3.20.