1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-21 06:10:16 +08:00

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
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 escape the value correctly for the native build system (note that CMake
language syntax may require escapes to specify some values). language syntax may require escapes to specify some values).
Arguments to ``add_compile_definitions`` may use "generator expressions" with .. |command_name| replace:: ``add_compile_definitions``
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` .. include:: GENEX_NOTE.txt
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
See Also See Also
^^^^^^^^ ^^^^^^^^

View File

@@ -14,10 +14,8 @@ directory and below.
Arguments Arguments
^^^^^^^^^ ^^^^^^^^^
Arguments to ``add_compile_options`` may use "generator expressions" with .. |command_name| replace:: ``add_compile_options``
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` .. include:: GENEX_NOTE.txt
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: OPTIONS_SHELL.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, since they do not use a linker. To add archiver or MSVC librarian flags,
see the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property. see the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
Arguments to ``add_link_options`` may use "generator expressions" with .. |command_name| replace:: ``add_link_options``
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` .. include:: GENEX_NOTE.txt
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: DEVICE_LINK_OPTIONS.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 skipping warnings, or these fixed-install system files not being
considered in dependency calculations - see compiler docs. considered in dependency calculations - see compiler docs.
Arguments to ``include_directories`` may use "generator expressions" with .. |command_name| replace:: ``include_directories``
the syntax "$<...>". See the :manual:`cmake-generator-expressions(7)` .. include:: GENEX_NOTE.txt
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. note:: .. note::

View File

@@ -25,10 +25,8 @@ same ``<target>`` append items in the order called.
.. versionadded:: 3.11 .. versionadded:: 3.11
Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`. Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
Arguments to ``target_compile_definitions`` may use "generator expressions" .. |command_name| replace:: ``target_compile_definitions``
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` .. include:: GENEX_NOTE.txt
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
Any leading ``-D`` on an item will be removed. Empty items are ignored. Any leading ``-D`` on an item will be removed. Empty items are ignored.
For example, the following are all equivalent: 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 :command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`. :ref:`ALIAS target <Alias Targets>`.
Arguments to ``target_compile_features`` may use "generator expressions" .. |command_name| replace:: ``target_compile_features``
with the syntax ``$<...>``. .. |more_see_also| replace:: See the :manual:`cmake-compile-features(7)`
See the :manual:`cmake-generator-expressions(7)` manual for available manual for information on compile features and a list of supported compilers.
expressions. See the :manual:`cmake-compile-features(7)` manual for .. include:: GENEX_NOTE.txt
information on compile features and a list of supported compilers. :start-line: 1
See Also See Also
^^^^^^^^ ^^^^^^^^

View File

@@ -32,10 +32,8 @@ The following arguments specify compile options. Repeated calls for the same
.. versionadded:: 3.11 .. versionadded:: 3.11
Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`. Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
Arguments to ``target_compile_options`` may use "generator expressions" .. |command_name| replace:: ``target_compile_options``
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` .. include:: GENEX_NOTE.txt
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: OPTIONS_SHELL.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 :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` target property will be
populated with the specified directories. populated with the specified directories.
Arguments to ``target_include_directories`` may use "generator expressions" .. |command_name| replace:: ``target_include_directories``
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` .. include:: GENEX_NOTE.txt
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
Specified include directories may be absolute paths or relative paths. Specified include directories may be absolute paths or relative paths.
A relative path will be interpreted as relative to the current source 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 If ``BEFORE`` is specified, the content will be prepended to the relevant
property instead of being appended. property instead of being appended.
Arguments to ``target_link_directories`` may use "generator expressions" .. |command_name| replace:: ``target_link_directories``
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` .. include:: GENEX_NOTE.txt
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. note:: .. note::

View File

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

View File

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