mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 11:18:40 +08:00
Help: Clarify version adding add_custom_{command,target} OUTPUT genex support
Update the documentation added by commit c257c25419
(add_custom_{command,target}: Add genex support to OUTPUT and
BYPRODUCTS, 2020-10-19) to use sphinx markup instead of prose to specify
the version in which the feature was added.
This commit is contained in:
@@ -79,7 +79,8 @@ The options are:
|
|||||||
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
|
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
|
||||||
:prop_sf:`GENERATED` files during ``make clean``.
|
:prop_sf:`GENERATED` files during ``make clean``.
|
||||||
|
|
||||||
Since CMake 3.20, arguments to ``BYPRODUCTS`` may use
|
.. versionadded:: 3.20
|
||||||
|
Arguments to ``BYPRODUCTS`` may use
|
||||||
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||||
|
|
||||||
``COMMAND``
|
``COMMAND``
|
||||||
@@ -229,7 +230,8 @@ The options are:
|
|||||||
as a file on disk it should be marked with the :prop_sf:`SYMBOLIC`
|
as a file on disk it should be marked with the :prop_sf:`SYMBOLIC`
|
||||||
source file property.
|
source file property.
|
||||||
|
|
||||||
Since CMake 3.20, arguments to ``OUTPUT`` may use
|
.. versionadded:: 3.20
|
||||||
|
Arguments to ``OUTPUT`` may use
|
||||||
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||||
|
|
||||||
``USES_TERMINAL``
|
``USES_TERMINAL``
|
||||||
@@ -291,10 +293,11 @@ adds a custom command to run ``someTool`` to generate ``out.c`` and then
|
|||||||
compile the generated source as part of a library. The generation rule
|
compile the generated source as part of a library. The generation rule
|
||||||
will re-run whenever ``in.txt`` changes.
|
will re-run whenever ``in.txt`` changes.
|
||||||
|
|
||||||
Since CMake 3.20, one may use generator expressions to specify
|
.. versionadded:: 3.20
|
||||||
per-configuration outputs. For example, the code:
|
One may use generator expressions to specify per-configuration outputs.
|
||||||
|
For example, the code:
|
||||||
|
|
||||||
.. code-block:: cmake
|
.. code-block:: cmake
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "out-$<CONFIG>.c"
|
OUTPUT "out-$<CONFIG>.c"
|
||||||
@@ -305,9 +308,9 @@ per-configuration outputs. For example, the code:
|
|||||||
VERBATIM)
|
VERBATIM)
|
||||||
add_library(myLib "out-$<CONFIG>.c")
|
add_library(myLib "out-$<CONFIG>.c")
|
||||||
|
|
||||||
adds a custom command to run ``someTool`` to generate ``out-<config>.c``,
|
adds a custom command to run ``someTool`` to generate ``out-<config>.c``,
|
||||||
where ``<config>`` is the build configuration, and then compile the generated
|
where ``<config>`` is the build configuration, and then compile the generated
|
||||||
source as part of a library.
|
source as part of a library.
|
||||||
|
|
||||||
Build Events
|
Build Events
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
@@ -377,10 +380,11 @@ For example, the code:
|
|||||||
will run ``someHasher`` to produce a ``.hash`` file next to the executable
|
will run ``someHasher`` to produce a ``.hash`` file next to the executable
|
||||||
after linking.
|
after linking.
|
||||||
|
|
||||||
Since CMake 3.20, one may use generator expressions to specify
|
.. versionadded:: 3.20
|
||||||
per-configuration byproducts. For example, the code:
|
One may use generator expressions to specify per-configuration byproducts.
|
||||||
|
For example, the code:
|
||||||
|
|
||||||
.. code-block:: cmake
|
.. code-block:: cmake
|
||||||
|
|
||||||
add_library(myPlugin MODULE myPlugin.c)
|
add_library(myPlugin MODULE myPlugin.c)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
@@ -391,6 +395,6 @@ per-configuration byproducts. For example, the code:
|
|||||||
VERBATIM)
|
VERBATIM)
|
||||||
add_executable(myExe myExe.c "myPlugin-hash-$<CONFIG>.c")
|
add_executable(myExe myExe.c "myPlugin-hash-$<CONFIG>.c")
|
||||||
|
|
||||||
will run ``someHasher`` after linking ``myPlugin``, e.g. to produce a ``.c``
|
will run ``someHasher`` after linking ``myPlugin``, e.g. to produce a ``.c``
|
||||||
file containing code to check the hash of ``myPlugin`` that the ``myExe``
|
file containing code to check the hash of ``myPlugin`` that the ``myExe``
|
||||||
executable can use to verify it before loading.
|
executable can use to verify it before loading.
|
||||||
|
@@ -54,7 +54,8 @@ The options are:
|
|||||||
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
|
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
|
||||||
:prop_sf:`GENERATED` files during ``make clean``.
|
:prop_sf:`GENERATED` files during ``make clean``.
|
||||||
|
|
||||||
Since CMake 3.20, arguments to ``BYPRODUCTS`` may use
|
.. versionadded:: 3.20
|
||||||
|
Arguments to ``BYPRODUCTS`` may use
|
||||||
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||||
|
|
||||||
``COMMAND``
|
``COMMAND``
|
||||||
|
Reference in New Issue
Block a user