add_custom_command: Target-dependent generator expression support

OUTPUT variant with a TARGET given to allow resolving target-based generator
expressions wouldn't work because OUTPUT is resolved before generator targets
are created, i.e. FindGeneratorTargetToUse() returns nullptr.
This is a known limitation, see #21364.

Implements #21336.
This commit is contained in:
Raul Tambre
2020-12-19 14:14:18 +02:00
parent 7676e11943
commit 1cb4f592a0
9 changed files with 65 additions and 7 deletions
+5
View File
@@ -338,6 +338,8 @@ will re-run whenever ``in.txt`` changes.
where ``<config>`` is the build configuration, and then compile the generated
source as part of a library.
.. _`add_custom_command(TARGET)`:
Build Events
^^^^^^^^^^^^
@@ -388,6 +390,9 @@ of the following is specified:
This allows to add individual build events for every configuration.
.. versionadded:: 3.21
Support for target-dependent generator expressions.
Examples: Build Events
^^^^^^^^^^^^^^^^^^^^^^