Help: Mention of CMP0112 in add_custom_command docs is misleading
https://cmake.org/cmake/help/v3.21/command/add_custom_command.html has the following paragraph, with my own emphasis added.
--snip--
Arguments to COMMAND may use generator expressions. Use the TARGET_FILE generator expression to refer to the location of a target later in the command line (i.e. as a command argument rather than as the command to execute).
Whenever one of the following target based generator expressions are used as a command to execute or is mentioned in a command argument, a target-level dependency will be added automatically so that the mentioned target will be built before any target using this custom command (see policy CMP0112
).
--snip--
Policy CMP0112
says that the new behavior is NOT to add a target level dependency. I think the wording of the docs in add_custom_command
should be improved to convey that better.