Help: Move a note about arguments and genexes into include file

This commit is contained in:
Alex Turbov 2022-11-07 01:27:21 +04:00
parent 968224484f
commit d4d1f85297
No known key found for this signature in database
GPG Key ID: 8BEDB7D11F95D5E3
12 changed files with 39 additions and 52 deletions

View File

@ -0,0 +1,6 @@
.. |more_see_also| replace:: See the :manual:`cmake-buildsystem(7)` manual
for more on defining buildsystem properties.
Arguments to |command_name| may use generator expressions
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. |more_see_also|

View File

@ -21,10 +21,8 @@ Function-style definitions are not supported. CMake will automatically
escape the value correctly for the native build system (note that CMake
language syntax may require escapes to specify some values).
Arguments to ``add_compile_definitions`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``add_compile_definitions``
.. include:: GENEX_NOTE.txt
See Also
^^^^^^^^

View File

@ -14,10 +14,8 @@ directory and below.
Arguments
^^^^^^^^^
Arguments to ``add_compile_options`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``add_compile_options``
.. include:: GENEX_NOTE.txt
.. include:: OPTIONS_SHELL.txt

View File

@ -23,10 +23,8 @@ exist to add libraries (:command:`target_link_libraries` or
since they do not use a linker. To add archiver or MSVC librarian flags,
see the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
Arguments to ``add_link_options`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``add_link_options``
.. include:: GENEX_NOTE.txt
.. include:: DEVICE_LINK_OPTIONS.txt

View File

@ -29,10 +29,8 @@ Signalling this setting might achieve effects such as the compiler
skipping warnings, or these fixed-install system files not being
considered in dependency calculations - see compiler docs.
Arguments to ``include_directories`` may use "generator expressions" with
the syntax "$<...>". See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``include_directories``
.. include:: GENEX_NOTE.txt
.. note::

View File

@ -25,10 +25,8 @@ same ``<target>`` append items in the order called.
.. versionadded:: 3.11
Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
Arguments to ``target_compile_definitions`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``target_compile_definitions``
.. include:: GENEX_NOTE.txt
Any leading ``-D`` on an item will be removed. Empty items are ignored.
For example, the following are all equivalent:

View File

@ -30,11 +30,11 @@ The named ``<target>`` must have been created by a command such as
:command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`.
Arguments to ``target_compile_features`` may use "generator expressions"
with the syntax ``$<...>``.
See the :manual:`cmake-generator-expressions(7)` manual for available
expressions. See the :manual:`cmake-compile-features(7)` manual for
information on compile features and a list of supported compilers.
.. |command_name| replace:: ``target_compile_features``
.. |more_see_also| replace:: See the :manual:`cmake-compile-features(7)`
manual for information on compile features and a list of supported compilers.
.. include:: GENEX_NOTE.txt
:start-line: 1
See Also
^^^^^^^^

View File

@ -32,10 +32,8 @@ The following arguments specify compile options. Repeated calls for the same
.. versionadded:: 3.11
Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
Arguments to ``target_compile_options`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``target_compile_options``
.. include:: GENEX_NOTE.txt
.. include:: OPTIONS_SHELL.txt

View File

@ -40,10 +40,8 @@ If ``SYSTEM`` is used together with ``PUBLIC`` or ``INTERFACE``, the
:prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` target property will be
populated with the specified directories.
Arguments to ``target_include_directories`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``target_include_directories``
.. include:: GENEX_NOTE.txt
Specified include directories may be absolute paths or relative paths.
A relative path will be interpreted as relative to the current source

View File

@ -34,10 +34,8 @@ calls for the same ``<target>`` append items in the order called.
If ``BEFORE`` is specified, the content will be prepended to the relevant
property instead of being appended.
Arguments to ``target_link_directories`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``target_link_directories``
.. include:: GENEX_NOTE.txt
.. note::

View File

@ -42,10 +42,8 @@ The following arguments specify link options. Repeated calls for the same
.. note::
:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.
Arguments to ``target_link_options`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. |command_name| replace:: ``target_link_options``
.. include:: GENEX_NOTE.txt
.. include:: DEVICE_LINK_OPTIONS.txt

View File

@ -70,17 +70,16 @@ included by absolute path. For example:
<unordered_map>
)
Arguments to ``target_precompile_headers()`` may use "generator expressions"
with the syntax ``$<...>``.
See the :manual:`cmake-generator-expressions(7)` manual for available
expressions.
The :genex:`$<COMPILE_LANGUAGE:...>` generator expression is particularly
useful for specifying a language-specific header to precompile for
only one language (e.g. ``CXX`` and not ``C``). In this case, header
file names that are not explicitly in double quotes or angle brackets
must be specified by absolute path. Also, when specifying angle brackets
inside a generator expression, be sure to encode the closing ``>`` as
:genex:`$<ANGLE-R>`. For example:
.. |command_name| replace:: ``target_compile_features``
.. |more_see_also| replace:: The :genex:`$<COMPILE_LANGUAGE:...>` generator
expression is particularly useful for specifying a language-specific header
to precompile for only one language (e.g. ``CXX`` and not ``C``). In this
case, header file names that are not explicitly in double quotes or angle
brackets must be specified by absolute path. Also, when specifying angle
brackets inside a generator expression, be sure to encode the closing
``>`` as :genex:`$<ANGLE-R>`. For example:
.. include:: GENEX_NOTE.txt
:start-line: 1
.. code-block:: cmake