From 00b788e85ee9ebdbf2c40ea9b71a0b1bdf07c99d Mon Sep 17 00:00:00 2001 From: Hinell Date: Fri, 9 Sep 2022 22:40:24 +0300 Subject: Help:custom_command: link policy on BYPRODUCTS Link policy explaining BYPRODUCTS. Fixes: #23786 --- Help/command/add_custom_command.rst | 2 ++ Help/policy/CMP0058.rst | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst index 9e60d2d..523e1b3 100644 --- a/Help/command/add_custom_command.rst +++ b/Help/command/add_custom_command.rst @@ -67,6 +67,8 @@ The options are: Each byproduct file will be marked with the :prop_sf:`GENERATED` source file property automatically. + *See policy* :policy:`CMP0058` *for the motivation behind this feature.* + Explicit specification of byproducts is supported by the :generator:`Ninja` generator to tell the ``ninja`` build tool how to regenerate byproducts when they are missing. It is diff --git a/Help/policy/CMP0058.rst b/Help/policy/CMP0058.rst index 06cc74b..a9a8f1c 100644 --- a/Help/policy/CMP0058.rst +++ b/Help/policy/CMP0058.rst @@ -71,6 +71,9 @@ every custom command dependency, even on source files, needs to be treated this way because CMake does not have enough information to know which files are generated as byproducts of custom commands. +Introducing Byproducts +^^^^^^^^^^^^^^^^^^^^^^ + CMake 3.2 introduced the ``BYPRODUCTS`` option to the :command:`add_custom_command` and :command:`add_custom_target` commands. This option allows byproducts to be specified explicitly: -- cgit v0.12