From 67f253a8d263b60de3bd71b57fc3cd7931e33f56 Mon Sep 17 00:00:00 2001 From: Tyler Yankee Date: Mon, 12 Oct 2026 10:12:50 -0400 Subject: [PATCH] Help: Factor out "may use generator expressions" This had already been factored out to `GENEX_NOTE.rst`, but wasn't applied very widely. Consolidate the language to consistently spell out (a) the reference to `cmake-buildsystem(7)` and (b) the prose 'with the syntax "$<...>"'. To accompany the change, modify cmRST to override redefinitions of substitutions within a single context instead of appending. Otherwise, with the new note files, `cmake --help-*` prints repeated fragments when it collates all scopes of a given field (e.g., all `prop_*/COMPILE_OPTIONS.rst` from `cmake --help-property COMPILE_OPTIONS`). --- Help/command/include/GENEX_NOTE.rst | 9 ++++----- Help/command/target_compile_features.rst | 5 ++--- Help/command/target_precompile_headers.rst | 17 ++++++++--------- Help/include/GENEX_NOTE.rst | 5 +++++ Help/include/GENEX_NOTE_PER_SOURCE.rst | 6 ++++++ Help/prop_dir/COMPILE_DEFINITIONS.rst | 6 ++---- Help/prop_dir/COMPILE_DEFINITIONS_CONFIG.rst | 6 ++---- Help/prop_dir/COMPILE_OPTIONS.rst | 6 ++---- Help/prop_dir/INCLUDE_DIRECTORIES.rst | 6 ++---- Help/prop_dir/LINK_DIRECTORIES.rst | 6 ++---- Help/prop_dir/LINK_OPTIONS.rst | 6 ++---- Help/prop_fs/COMPILE_DEFINITIONS.rst | 8 ++------ Help/prop_fs/COMPILE_OPTIONS.rst | 8 ++------ Help/prop_fs/INCLUDE_DIRECTORIES.rst | 7 ++----- .../include/INTERFACE_BUILD_PROPERTY.rst | 6 ++---- Help/prop_gbl/CMAKE_COMPILE_WRAPPER_NAME.rst | 6 ++---- Help/prop_gbl/CMAKE_LINK_WRAPPER_NAME.rst | 6 ++---- Help/prop_rule/COMPILE_DEFINITIONS.rst | 6 ++---- Help/prop_rule/COMPILE_OPTIONS.rst | 6 ++---- Help/prop_rule/INCLUDE_DIRECTORIES.rst | 6 ++---- Help/prop_sf/COMPILE_DEFINITIONS.rst | 8 ++------ Help/prop_sf/COMPILE_FLAGS.rst | 8 ++------ Help/prop_sf/COMPILE_OPTIONS.rst | 8 ++------ Help/prop_sf/INCLUDE_DIRECTORIES.rst | 7 ++----- Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst | 5 ++--- .../ANDROID_NATIVE_LIB_DEPENDENCIES.rst | 6 ++---- .../prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst | 5 ++--- Help/prop_tgt/AUTOUIC_OPTIONS.rst | 5 ++--- Help/prop_tgt/COMPILE_DEFINITIONS.rst | 6 ++---- Help/prop_tgt/COMPILE_DEFINITIONS_CONFIG.rst | 6 ++---- Help/prop_tgt/COMPILE_FEATURES.rst | 8 ++++---- Help/prop_tgt/COMPILE_OPTIONS.rst | 6 ++---- Help/prop_tgt/COMPILE_WRAPPERS.rst | 6 ++---- Help/prop_tgt/EXCLUDE_FROM_ALL.rst | 4 ++-- Help/prop_tgt/INCLUDE_DIRECTORIES.rst | 6 ++---- Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst | 4 ++-- Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst | 6 ++---- Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst | 6 ++---- .../INTERFACE_POSITION_INDEPENDENT_CODE.rst | 7 ++----- Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst | 6 ++---- Help/prop_tgt/INTERFACE_SOURCES.rst | 6 ++---- .../INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst | 7 ++----- Help/prop_tgt/LINK_DEPENDS.rst | 6 ++---- Help/prop_tgt/LINK_DIRECTORIES.rst | 6 ++---- Help/prop_tgt/LINK_LIBRARIES.rst | 10 ++++------ Help/prop_tgt/LINK_OPTIONS.rst | 6 ++---- Help/prop_tgt/LINK_WRAPPERS.rst | 6 ++---- Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst | 6 ++---- Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst | 7 ++----- .../include/INTERFACE_BUILD_PROPERTY.rst | 6 ++---- .../CMAKE_XCODE_ATTRIBUTE_an-attribute.rst | 7 ++----- Source/cmRST.cxx | 5 +++-- Tests/CMakeLib/testRST.expect | 2 ++ Tests/CMakeLib/testRST.rst | 5 +++++ 54 files changed, 131 insertions(+), 214 deletions(-) create mode 100644 Help/include/GENEX_NOTE.rst create mode 100644 Help/include/GENEX_NOTE_PER_SOURCE.rst diff --git a/Help/command/include/GENEX_NOTE.rst b/Help/command/include/GENEX_NOTE.rst index 4a7906ce95..a5e43925ae 100644 --- a/Help/command/include/GENEX_NOTE.rst +++ b/Help/command/include/GENEX_NOTE.rst @@ -1,6 +1,5 @@ -.. |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| +Arguments to |command_name| may use +:manual:`generator expressions ` with the +syntax ``$<...>``. See the :manual:`cmake-buildsystem(7)` manual for more on +defining buildsystem properties. diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst index 05b48c47ef..e770776153 100644 --- a/Help/command/target_compile_features.rst +++ b/Help/command/target_compile_features.rst @@ -36,10 +36,9 @@ The named ```` must have been created by a command such as operates on the target which the alias references. .. |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:: include/GENEX_NOTE.rst - :start-line: 2 + +.. include:: /include/COMPILE_FEATURES_NOTE.rst See Also ^^^^^^^^ diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst index 2ade01d889..aa18024b4f 100644 --- a/Help/command/target_precompile_headers.rst +++ b/Help/command/target_precompile_headers.rst @@ -74,16 +74,15 @@ included by absolute path. For example: ) .. |command_name| replace:: ``target_precompile_headers`` -.. |more_see_also| replace:: The :genex:`$ - ` 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:`$`. For example: .. include:: include/GENEX_NOTE.rst - :start-line: 2 + +The :genex:`$ ` 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:`$`. For example: .. code-block:: cmake diff --git a/Help/include/GENEX_NOTE.rst b/Help/include/GENEX_NOTE.rst new file mode 100644 index 0000000000..4ff9c865e2 --- /dev/null +++ b/Help/include/GENEX_NOTE.rst @@ -0,0 +1,5 @@ + +Contents of |genex_subject| may use +:manual:`generator expressions ` with the +syntax ``$<...>``. See the :manual:`cmake-buildsystem(7)` manual for more on +defining buildsystem properties. diff --git a/Help/include/GENEX_NOTE_PER_SOURCE.rst b/Help/include/GENEX_NOTE_PER_SOURCE.rst new file mode 100644 index 0000000000..8694c18c83 --- /dev/null +++ b/Help/include/GENEX_NOTE_PER_SOURCE.rst @@ -0,0 +1,6 @@ + +Contents of |genex_subject| may use +:manual:`generator expressions ` with the +syntax ``$<...>``. However, :generator:`Xcode` does not support per-config +per-source settings, so expressions that depend on the build configuration are +not allowed with that generator. diff --git a/Help/prop_dir/COMPILE_DEFINITIONS.rst b/Help/prop_dir/COMPILE_DEFINITIONS.rst index fe31cdbeb4..0e26dd0cf5 100644 --- a/Help/prop_dir/COMPILE_DEFINITIONS.rst +++ b/Help/prop_dir/COMPILE_DEFINITIONS.rst @@ -24,10 +24,8 @@ by the native build tool. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.rst -Contents of ``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. +.. |genex_subject| replace:: ``COMPILE_DEFINITIONS`` +.. include:: ../include/GENEX_NOTE.rst The corresponding :prop_dir:`COMPILE_DEFINITIONS_` property may be set to specify per-configuration definitions. Generator expressions diff --git a/Help/prop_dir/COMPILE_DEFINITIONS_CONFIG.rst b/Help/prop_dir/COMPILE_DEFINITIONS_CONFIG.rst index a6af45f35b..fae7ed5d3b 100644 --- a/Help/prop_dir/COMPILE_DEFINITIONS_CONFIG.rst +++ b/Help/prop_dir/COMPILE_DEFINITIONS_CONFIG.rst @@ -11,9 +11,7 @@ where ```` is an upper-case name (ex. ``COMPILE_DEFINITIONS_DEBUG``). This property will be initialized in each directory by its value in the directory's parent. -Contents of ``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. +.. |genex_subject| replace:: ``COMPILE_DEFINITIONS_`` +.. include:: ../include/GENEX_NOTE.rst Generator expressions should be preferred instead of setting this property. diff --git a/Help/prop_dir/COMPILE_OPTIONS.rst b/Help/prop_dir/COMPILE_OPTIONS.rst index 48e8b9b8d6..3b10685749 100644 --- a/Help/prop_dir/COMPILE_OPTIONS.rst +++ b/Help/prop_dir/COMPILE_OPTIONS.rst @@ -10,7 +10,5 @@ This property is used to initialize the :prop_tgt:`COMPILE_OPTIONS` target property when a target is created, which is used by the generators to set the options for the compiler. -Contents of ``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. +.. |genex_subject| replace:: ``COMPILE_OPTIONS`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_dir/INCLUDE_DIRECTORIES.rst b/Help/prop_dir/INCLUDE_DIRECTORIES.rst index 5d856b80a8..28ad87dcc2 100644 --- a/Help/prop_dir/INCLUDE_DIRECTORIES.rst +++ b/Help/prop_dir/INCLUDE_DIRECTORIES.rst @@ -26,7 +26,5 @@ they are meant to affect. The target property values are used by the generators to set the include paths for the compiler. -Contents of ``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. +.. |genex_subject| replace:: ``INCLUDE_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_dir/LINK_DIRECTORIES.rst b/Help/prop_dir/LINK_DIRECTORIES.rst index 44dc2304e9..ab5522b7d1 100644 --- a/Help/prop_dir/LINK_DIRECTORIES.rst +++ b/Help/prop_dir/LINK_DIRECTORIES.rst @@ -11,7 +11,5 @@ The directory property is used to initialize the :prop_tgt:`LINK_DIRECTORIES` target property when a target is created. That target property is used by the generators to set the library search directories for the linker. -Contents of ``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. +.. |genex_subject| replace:: ``LINK_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_dir/LINK_OPTIONS.rst b/Help/prop_dir/LINK_OPTIONS.rst index 3a5c72ff09..4fe3fdbb8f 100644 --- a/Help/prop_dir/LINK_OPTIONS.rst +++ b/Help/prop_dir/LINK_OPTIONS.rst @@ -13,7 +13,5 @@ This property is used to initialize the :prop_tgt:`LINK_OPTIONS` target property when a target is created, which is used by the generators to set the options for the compiler. -Contents of ``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. +.. |genex_subject| replace:: ``LINK_OPTIONS`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_fs/COMPILE_DEFINITIONS.rst b/Help/prop_fs/COMPILE_DEFINITIONS.rst index 23fbf0143e..eaf465c173 100644 --- a/Help/prop_fs/COMPILE_DEFINITIONS.rst +++ b/Help/prop_fs/COMPILE_DEFINITIONS.rst @@ -17,12 +17,8 @@ per-configuration definitions on source files. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.rst -Contents of ``COMPILE_DEFINITIONS`` may use :manual:`cmake-generator-expressions(7)` -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. However, :generator:`Xcode` -does not support per-config per-source settings, so expressions -that depend on the build configuration are not allowed with that -generator. +.. |genex_subject| replace:: ``COMPILE_DEFINITIONS`` +.. include:: ../include/GENEX_NOTE_PER_SOURCE.rst Related properties: diff --git a/Help/prop_fs/COMPILE_OPTIONS.rst b/Help/prop_fs/COMPILE_OPTIONS.rst index 70614b1bdb..ad5744c3f1 100644 --- a/Help/prop_fs/COMPILE_OPTIONS.rst +++ b/Help/prop_fs/COMPILE_OPTIONS.rst @@ -10,12 +10,8 @@ of options and will be added to the list of compile flags when the sources of this file set are built. The options will be added after target-wide options and source level ones. -Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the -syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual -for available expressions. However, :generator:`Xcode` -does not support per-config per-source settings, so expressions -that depend on the build configuration are not allowed with that -generator. +.. |genex_subject| replace:: ``COMPILE_OPTIONS`` +.. include:: ../include/GENEX_NOTE_PER_SOURCE.rst Usage example: diff --git a/Help/prop_fs/INCLUDE_DIRECTORIES.rst b/Help/prop_fs/INCLUDE_DIRECTORIES.rst index 4f983db122..4d559d0934 100644 --- a/Help/prop_fs/INCLUDE_DIRECTORIES.rst +++ b/Help/prop_fs/INCLUDE_DIRECTORIES.rst @@ -13,11 +13,8 @@ directories defined at target level and source level except for Relative paths should not be added to this property directly. -Contents of ``INCLUDE_DIRECTORIES`` may use "generator expressions" with -the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual -for available expressions. However, :generator:`Xcode` does not support -per-config per-source settings, so expressions that depend on the build -configuration are not allowed with that generator. +.. |genex_subject| replace:: ``INCLUDE_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE_PER_SOURCE.rst Related properties: diff --git a/Help/prop_fs/include/INTERFACE_BUILD_PROPERTY.rst b/Help/prop_fs/include/INTERFACE_BUILD_PROPERTY.rst index b2e39f1d5b..bf0ec2a7a5 100644 --- a/Help/prop_fs/include/INTERFACE_BUILD_PROPERTY.rst +++ b/Help/prop_fs/include/INTERFACE_BUILD_PROPERTY.rst @@ -10,7 +10,5 @@ determine the build properties of the consumer. These build properties are only applied to the sources of the file sets. The other sources of the consumer are unaffected. -Contents of |PROPERTY_INTERFACE_NAME| 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. +.. |genex_subject| replace:: |PROPERTY_INTERFACE_NAME| +.. include:: /include/GENEX_NOTE.rst diff --git a/Help/prop_gbl/CMAKE_COMPILE_WRAPPER_NAME.rst b/Help/prop_gbl/CMAKE_COMPILE_WRAPPER_NAME.rst index 413ef30376..4bb5cc9ad0 100644 --- a/Help/prop_gbl/CMAKE_COMPILE_WRAPPER_NAME.rst +++ b/Help/prop_gbl/CMAKE_COMPILE_WRAPPER_NAME.rst @@ -20,10 +20,8 @@ The value is a :ref:`semicolon-separated list ` of command line arguments. Empty arguments are preserved, and a literal semicolon within an argument may be written as ``\;``. -Contents of ``CMAKE_COMPILE_WRAPPER_`` 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. +.. |genex_subject| replace:: ``CMAKE_COMPILE_WRAPPER_`` +.. include:: ../include/GENEX_NOTE.rst Example ^^^^^^^ diff --git a/Help/prop_gbl/CMAKE_LINK_WRAPPER_NAME.rst b/Help/prop_gbl/CMAKE_LINK_WRAPPER_NAME.rst index 4375fb3b7b..e690e4b4aa 100644 --- a/Help/prop_gbl/CMAKE_LINK_WRAPPER_NAME.rst +++ b/Help/prop_gbl/CMAKE_LINK_WRAPPER_NAME.rst @@ -20,10 +20,8 @@ The value is a :ref:`semicolon-separated list ` of command line arguments. Empty arguments are preserved, and a literal semicolon within an argument may be written as ``\;``. -Contents of ``CMAKE_LINK_WRAPPER_`` 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. +.. |genex_subject| replace:: ``CMAKE_LINK_WRAPPER_`` +.. include:: ../include/GENEX_NOTE.rst Example ^^^^^^^ diff --git a/Help/prop_rule/COMPILE_DEFINITIONS.rst b/Help/prop_rule/COMPILE_DEFINITIONS.rst index 1268cfc4a3..07b73ed828 100644 --- a/Help/prop_rule/COMPILE_DEFINITIONS.rst +++ b/Help/prop_rule/COMPILE_DEFINITIONS.rst @@ -18,7 +18,5 @@ by the native build tool. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.rst -Contents of ``COMPILE_DEFINITIONS`` may use :manual:`generator expressions -` with the syntax ``$<...>``. See the -:manual:`cmake-buildsystem(7)` manual for more on defining buildsystem -properties. +.. |genex_subject| replace:: ``COMPILE_DEFINITIONS`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_rule/COMPILE_OPTIONS.rst b/Help/prop_rule/COMPILE_OPTIONS.rst index 9f9b03d0c0..31cadd4cf9 100644 --- a/Help/prop_rule/COMPILE_OPTIONS.rst +++ b/Help/prop_rule/COMPILE_OPTIONS.rst @@ -9,9 +9,7 @@ This property holds a :ref:`semicolon-separated list ` of options specified so far for its rule. Use the :command:`set_property(RULE)` command to append more options. -Contents of ``COMPILE_OPTIONS`` may use :manual:`generator expressions -` with the syntax ``$<...>``. See the -:manual:`cmake-buildsystem(7)` manual for more on defining buildsystem -properties. +.. |genex_subject| replace:: ``COMPILE_OPTIONS`` +.. include:: ../include/GENEX_NOTE.rst .. include:: ../command/include/OPTIONS_SHELL.rst diff --git a/Help/prop_rule/INCLUDE_DIRECTORIES.rst b/Help/prop_rule/INCLUDE_DIRECTORIES.rst index 791693fc0e..5a9ea3f1d8 100644 --- a/Help/prop_rule/INCLUDE_DIRECTORIES.rst +++ b/Help/prop_rule/INCLUDE_DIRECTORIES.rst @@ -14,7 +14,5 @@ paths for the compiler. Relative paths should not be added to this property. -Contents of ``INCLUDE_DIRECTORIES`` may use :manual:`generator expressions -` with the syntax ``$<...>``. See the -:manual:`cmake-buildsystem(7)` manual for more on defining buildsystem -properties. +.. |genex_subject| replace:: ``INCLUDE_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_sf/COMPILE_DEFINITIONS.rst b/Help/prop_sf/COMPILE_DEFINITIONS.rst index 9c75d40416..f0a8262c4d 100644 --- a/Help/prop_sf/COMPILE_DEFINITIONS.rst +++ b/Help/prop_sf/COMPILE_DEFINITIONS.rst @@ -21,12 +21,8 @@ definitions on source files. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.rst -Contents of ``COMPILE_DEFINITIONS`` may use :manual:`cmake-generator-expressions(7)` -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. However, :generator:`Xcode` -does not support per-config per-source settings, so expressions -that depend on the build configuration are not allowed with that -generator. +.. |genex_subject| replace:: ``COMPILE_DEFINITIONS`` +.. include:: ../include/GENEX_NOTE_PER_SOURCE.rst Prefer using generator expressions in :prop_sf:`!COMPILE_DEFINITIONS` over the deprecated :prop_sf:`COMPILE_DEFINITIONS_` property. diff --git a/Help/prop_sf/COMPILE_FLAGS.rst b/Help/prop_sf/COMPILE_FLAGS.rst index 1d3def47b4..7d48776395 100644 --- a/Help/prop_sf/COMPILE_FLAGS.rst +++ b/Help/prop_sf/COMPILE_FLAGS.rst @@ -9,12 +9,8 @@ file builds. The flags will be added after target-wide flags. Use :prop_sf:`COMPILE_DEFINITIONS` to pass additional preprocessor definitions. -Contents of ``COMPILE_FLAGS`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. However, :generator:`Xcode` -does not support per-config per-source settings, so expressions -that depend on the build configuration are not allowed with that -generator. +.. |genex_subject| replace:: ``COMPILE_FLAGS`` +.. include:: ../include/GENEX_NOTE_PER_SOURCE.rst .. note:: diff --git a/Help/prop_sf/COMPILE_OPTIONS.rst b/Help/prop_sf/COMPILE_OPTIONS.rst index 9b00e0ebb9..e51ede33d1 100644 --- a/Help/prop_sf/COMPILE_OPTIONS.rst +++ b/Help/prop_sf/COMPILE_OPTIONS.rst @@ -9,12 +9,8 @@ This property holds a :ref:`semicolon-separated list ` of options and will be added to the list of compile flags when this source file builds. The options will be added after target-wide options. -Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the -syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual -for available expressions. However, :generator:`Xcode` -does not support per-config per-source settings, so expressions -that depend on the build configuration are not allowed with that -generator. +.. |genex_subject| replace:: ``COMPILE_OPTIONS`` +.. include:: ../include/GENEX_NOTE_PER_SOURCE.rst Usage example: diff --git a/Help/prop_sf/INCLUDE_DIRECTORIES.rst b/Help/prop_sf/INCLUDE_DIRECTORIES.rst index 89ffd15605..a58b4a2fb9 100644 --- a/Help/prop_sf/INCLUDE_DIRECTORIES.rst +++ b/Help/prop_sf/INCLUDE_DIRECTORIES.rst @@ -13,8 +13,5 @@ limitations. Relative paths should not be added to this property directly. -Contents of ``INCLUDE_DIRECTORIES`` may use "generator expressions" with -the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual -for available expressions. However, :generator:`Xcode` does not support -per-config per-source settings, so expressions that depend on the build -configuration are not allowed with that generator. +.. |genex_subject| replace:: ``INCLUDE_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE_PER_SOURCE.rst diff --git a/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst index 6fef50b2d6..7d0c01ef3c 100644 --- a/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst +++ b/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst @@ -11,6 +11,5 @@ semicolons. This property is initialized by the value of the :variable:`CMAKE_ANDROID_JAR_DIRECTORIES` variable if it is set when a target is created. -Contents of ``ANDROID_JAR_DIRECTORIES`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. +.. |genex_subject| replace:: ``ANDROID_JAR_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst b/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst index 3aa741f90e..760b3c7523 100644 --- a/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst +++ b/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst @@ -10,7 +10,5 @@ This property is initialized by the value of the :variable:`CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES` variable if it is set when a target is created. -Contents of ``ANDROID_NATIVE_LIB_DEPENDENCIES`` may use -"generator expressions" with the syntax ``$<...>``. See the -:manual:`cmake-generator-expressions(7)` manual for -available expressions. +.. |genex_subject| replace:: ``ANDROID_NATIVE_LIB_DEPENDENCIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst index 98200d9cea..823694f50d 100644 --- a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst +++ b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst @@ -13,6 +13,5 @@ This property is initialized by the value of the :variable:`CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES` variable if it is set when a target is created. -Contents of ``ANDROID_NATIVE_LIB_DIRECTORIES`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. +.. |genex_subject| replace:: ``ANDROID_NATIVE_LIB_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/AUTOUIC_OPTIONS.rst b/Help/prop_tgt/AUTOUIC_OPTIONS.rst index d601740602..d90aa03e95 100644 --- a/Help/prop_tgt/AUTOUIC_OPTIONS.rst +++ b/Help/prop_tgt/AUTOUIC_OPTIONS.rst @@ -17,9 +17,8 @@ created, or an empty string otherwise. The options set on the target may be overridden by :prop_sf:`AUTOUIC_OPTIONS` set on the ``.ui`` source file. -This property may use "generator expressions" with the syntax ``$<...>``. -See the :manual:`cmake-generator-expressions(7)` manual for available -expressions. +.. |genex_subject| replace:: ``AUTOUIC_OPTIONS`` +.. include:: ../include/GENEX_NOTE.rst See the :manual:`cmake-qt(7)` manual for more information on using CMake with Qt. diff --git a/Help/prop_tgt/COMPILE_DEFINITIONS.rst b/Help/prop_tgt/COMPILE_DEFINITIONS.rst index 56bf3b41d7..7907486c1a 100644 --- a/Help/prop_tgt/COMPILE_DEFINITIONS.rst +++ b/Help/prop_tgt/COMPILE_DEFINITIONS.rst @@ -18,10 +18,8 @@ by the native build tool. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.rst -Contents of ``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. +.. |genex_subject| replace:: ``COMPILE_DEFINITIONS`` +.. include:: ../include/GENEX_NOTE.rst The corresponding :prop_tgt:`COMPILE_DEFINITIONS_` property may be set to specify per-configuration definitions. Generator expressions diff --git a/Help/prop_tgt/COMPILE_DEFINITIONS_CONFIG.rst b/Help/prop_tgt/COMPILE_DEFINITIONS_CONFIG.rst index 84bd5e4831..37be5a0931 100644 --- a/Help/prop_tgt/COMPILE_DEFINITIONS_CONFIG.rst +++ b/Help/prop_tgt/COMPILE_DEFINITIONS_CONFIG.rst @@ -8,9 +8,7 @@ Per-configuration preprocessor definitions on a target. This is the configuration-specific version of :prop_tgt:`COMPILE_DEFINITIONS` where ```` is an upper-case name (ex. ``COMPILE_DEFINITIONS_DEBUG``). -Contents of ``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. +.. |genex_subject| replace:: ``COMPILE_DEFINITIONS_`` +.. include:: ../include/GENEX_NOTE.rst Generator expressions should be preferred instead of setting this property. diff --git a/Help/prop_tgt/COMPILE_FEATURES.rst b/Help/prop_tgt/COMPILE_FEATURES.rst index 9b937ed973..95dfeb6df7 100644 --- a/Help/prop_tgt/COMPILE_FEATURES.rst +++ b/Help/prop_tgt/COMPILE_FEATURES.rst @@ -9,7 +9,7 @@ The list of features in this property are a subset of the features listed in the :variable:`CMAKE_C_COMPILE_FEATURES`, :variable:`CMAKE_CUDA_COMPILE_FEATURES`, and :variable:`CMAKE_CXX_COMPILE_FEATURES` variables. -Contents of ``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. +Contents of ``COMPILE_FEATURES`` may use +:manual:`generator expressions `. +See the :manual:`cmake-compile-features(7)` manual for information on +compile features and a list of supported compilers. diff --git a/Help/prop_tgt/COMPILE_OPTIONS.rst b/Help/prop_tgt/COMPILE_OPTIONS.rst index 1b8d53f301..53f563a39d 100644 --- a/Help/prop_tgt/COMPILE_OPTIONS.rst +++ b/Help/prop_tgt/COMPILE_OPTIONS.rst @@ -19,9 +19,7 @@ This property is initialized by the :prop_dir:`COMPILE_OPTIONS` directory property when a target is created, and is used by the generators to set the options for the compiler. -Contents of ``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. +.. |genex_subject| replace:: ``COMPILE_OPTIONS`` +.. include:: ../include/GENEX_NOTE.rst .. include:: ../command/include/OPTIONS_SHELL.rst diff --git a/Help/prop_tgt/COMPILE_WRAPPERS.rst b/Help/prop_tgt/COMPILE_WRAPPERS.rst index 054341e0df..85ae615035 100644 --- a/Help/prop_tgt/COMPILE_WRAPPERS.rst +++ b/Help/prop_tgt/COMPILE_WRAPPERS.rst @@ -22,10 +22,8 @@ This property is supported only by :ref:`Makefile Generators` and supported only when the target's language is one of: ``C``, ``CXX``, ``CUDA``, ``Fortran``, ``HIP``, ``ISPC``, ``OBJC``, ``OBJCXX``. -Contents of ``COMPILE_WRAPPERS`` 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. +.. |genex_subject| replace:: ``COMPILE_WRAPPERS`` +.. include:: ../include/GENEX_NOTE.rst Interaction With Launchers ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst index 240fcd13e5..b124917ede 100644 --- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst +++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst @@ -20,8 +20,8 @@ in an :command:`install(TARGETS)` command, but the user is responsible for ensuring that the target's build artifacts are not missing or outdated when an install is performed. -This property may use "generator expressions" with the syntax ``$<...>``. See -the :manual:`cmake-generator-expressions(7)` manual for available expressions. +.. |genex_subject| replace:: ``EXCLUDE_FROM_ALL`` +.. include:: ../include/GENEX_NOTE.rst Only the "Ninja Multi-Config" generator supports a property value that varies by configuration. For all other generators the value of this property must be the diff --git a/Help/prop_tgt/INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INCLUDE_DIRECTORIES.rst index b381d1dbdf..a2ad76ae30 100644 --- a/Help/prop_tgt/INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INCLUDE_DIRECTORIES.rst @@ -18,7 +18,5 @@ paths for the compiler. Relative paths should not be added to this property directly. Use one of the commands above instead to handle relative paths. -Contents of ``INCLUDE_DIRECTORIES`` may use :manual:`cmake-generator-expressions(7)` 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. +.. |genex_subject| replace:: ``INCLUDE_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst b/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst index 2fe011aa03..d9cc40cf87 100644 --- a/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst +++ b/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst @@ -12,5 +12,5 @@ own :prop_tgt:`AUTOUIC_OPTIONS` property such as specified in the interface of ``foo``. This is done automatically by the :command:`target_link_libraries` command. -This property supports generator expressions. See the -:manual:`cmake-generator-expressions(7)` manual for available expressions. +.. |genex_subject| replace:: ``INTERFACE_AUTOUIC_OPTIONS`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst b/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst index a060799f1f..0b77241075 100644 --- a/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst +++ b/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst @@ -14,10 +14,8 @@ When target dependencies are specified using :command:`target_link_libraries`, CMake will read this property from all target dependencies to determine the build properties of the consumer. -Contents of ``INTERFACE_LINK_DEPENDS`` 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. +.. |genex_subject| replace:: ``INTERFACE_LINK_DEPENDS`` +.. include:: ../include/GENEX_NOTE.rst Link dependency files usage requirements commonly differ between the build-tree and the install-tree. The :genex:`BUILD_INTERFACE` and diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst index a73c22d255..eb07dbb232 100644 --- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst +++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst @@ -19,10 +19,8 @@ property, are linked first, followed by indirect dependencies from the transitive closure of the direct dependencies' ``INTERFACE_LINK_LIBRARIES`` properties. See policy :policy:`CMP0022`. -Contents of ``INTERFACE_LINK_LIBRARIES`` 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. +.. |genex_subject| replace:: ``INTERFACE_LINK_LIBRARIES`` +.. include:: ../include/GENEX_NOTE.rst .. include:: include/LINK_LIBRARIES_INDIRECTION.rst diff --git a/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst index 4336d71825..4e73d1ac97 100644 --- a/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst +++ b/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst @@ -15,8 +15,5 @@ undefined, then consumers will determine their must ensure that the targets that they link to have a consistent requirement for their ``INTERFACE_POSITION_INDEPENDENT_CODE`` property. -Contents of ``INTERFACE_POSITION_INDEPENDENT_CODE`` 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. +.. |genex_subject| replace:: ``INTERFACE_POSITION_INDEPENDENT_CODE`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst b/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst index 2299264535..5cbe1c1d9d 100644 --- a/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst +++ b/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst @@ -12,7 +12,5 @@ command populates this property with values given to the ``PUBLIC`` and See the discussion in :command:`target_precompile_headers` for guidance on appropriate use of this property for installed or exported targets. -Contents of ``INTERFACE_PRECOMPILE_HEADERS`` 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. +.. |genex_subject| replace:: ``INTERFACE_PRECOMPILE_HEADERS`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/INTERFACE_SOURCES.rst b/Help/prop_tgt/INTERFACE_SOURCES.rst index 759c482110..e103541db4 100644 --- a/Help/prop_tgt/INTERFACE_SOURCES.rst +++ b/Help/prop_tgt/INTERFACE_SOURCES.rst @@ -14,7 +14,5 @@ When target dependencies are specified using :command:`target_link_libraries`, CMake will read this property from all target dependencies to determine the sources of the consumer. -Contents of ``INTERFACE_SOURCES`` 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. +.. |genex_subject| replace:: ``INTERFACE_SOURCES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst index 2ded46f156..f39b86f415 100644 --- a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst @@ -24,8 +24,5 @@ When target dependencies are specified using :command:`target_link_libraries`, CMake will read this property from all target dependencies to mark the same include directories as containing system headers. -Contents of ``INTERFACE_SYSTEM_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. +.. |genex_subject| replace:: ``INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/LINK_DEPENDS.rst b/Help/prop_tgt/LINK_DEPENDS.rst index e59d4c014e..aad39c1f35 100644 --- a/Help/prop_tgt/LINK_DEPENDS.rst +++ b/Help/prop_tgt/LINK_DEPENDS.rst @@ -12,7 +12,5 @@ This property is supported only by :generator:`Ninja` and intended to specify dependencies on "linker scripts" for custom Makefile link rules. -Contents of ``LINK_DEPENDS`` 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. +.. |genex_subject| replace:: ``LINK_DEPENDS`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/LINK_DIRECTORIES.rst b/Help/prop_tgt/LINK_DIRECTORIES.rst index 67be494ce9..b480c17f8c 100644 --- a/Help/prop_tgt/LINK_DIRECTORIES.rst +++ b/Help/prop_tgt/LINK_DIRECTORIES.rst @@ -14,7 +14,5 @@ This property is initialized by the :prop_dir:`LINK_DIRECTORIES` directory property when a target is created, and is used by the generators to set the search directories for the linker. -Contents of ``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. +.. |genex_subject| replace:: ``LINK_DIRECTORIES`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/LINK_LIBRARIES.rst b/Help/prop_tgt/LINK_LIBRARIES.rst index e5aa3c68f3..c954b87448 100644 --- a/Help/prop_tgt/LINK_LIBRARIES.rst +++ b/Help/prop_tgt/LINK_LIBRARIES.rst @@ -14,13 +14,11 @@ followed by indirect dependencies from the transitive closure of the direct dependencies' :prop_tgt:`INTERFACE_LINK_LIBRARIES` properties. See policy :policy:`CMP0022`. -Contents of ``LINK_LIBRARIES`` may use -:manual:`generator expressions ` with the -syntax ``$<...>``. Policy :policy:`CMP0131` affects the behavior of the -:genex:`LINK_ONLY` generator expression for this property. +.. |genex_subject| replace:: ``LINK_LIBRARIES`` +.. include:: ../include/GENEX_NOTE.rst -See the :manual:`cmake-buildsystem(7)` manual for more on defining -buildsystem properties. +Policy :policy:`CMP0131` affects the behavior of the +:genex:`LINK_ONLY` generator expression for this property. .. include:: include/LINK_LIBRARIES_INDIRECTION.rst diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst index fd14c9675e..14b5edaa5e 100644 --- a/Help/prop_tgt/LINK_OPTIONS.rst +++ b/Help/prop_tgt/LINK_OPTIONS.rst @@ -20,10 +20,8 @@ This property is initialized by the :prop_dir:`LINK_OPTIONS` directory property when a target is created, and is used by the generators to set the options for the compiler. -Contents of ``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. +.. |genex_subject| replace:: ``LINK_OPTIONS`` +.. include:: ../include/GENEX_NOTE.rst .. note:: diff --git a/Help/prop_tgt/LINK_WRAPPERS.rst b/Help/prop_tgt/LINK_WRAPPERS.rst index ce51132acb..b6137919fc 100644 --- a/Help/prop_tgt/LINK_WRAPPERS.rst +++ b/Help/prop_tgt/LINK_WRAPPERS.rst @@ -22,10 +22,8 @@ This property is supported only by :ref:`Makefile Generators` and supported only when the target's language is one of: ``C``, ``CXX``, ``CUDA``, ``OBJC``, ``OBJCXX``, ``Fortran``, ``HIP``. -Contents of ``LINK_WRAPPERS`` 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. +.. |genex_subject| replace:: ``LINK_WRAPPERS`` +.. include:: ../include/GENEX_NOTE.rst Wrappers apply to the link command of executables, shared libraries, and module libraries. As with :prop_tgt:`_LINKER_LAUNCHER`, they do not diff --git a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst index 2a9c4a9026..ce6c535faf 100644 --- a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst +++ b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst @@ -11,10 +11,8 @@ This property holds a :ref:`semicolon-separated list ` of specified so far for its target. Use :command:`set_target_properties` or :command:`set_property` commands to set its content. -Contents of ``STATIC_LIBRARY_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. +.. |genex_subject| replace:: ``STATIC_LIBRARY_OPTIONS`` +.. include:: ../include/GENEX_NOTE.rst .. note:: diff --git a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst index fbe760815f..ae191a4f35 100644 --- a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst +++ b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst @@ -15,8 +15,5 @@ model of the project and can break things. See the :variable:`CMAKE_XCODE_ATTRIBUTE_` variable to set attributes on all targets in a directory tree. -Contents of ``XCODE_ATTRIBUTE_`` 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. +.. |genex_subject| replace:: ``XCODE_ATTRIBUTE_`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Help/prop_tgt/include/INTERFACE_BUILD_PROPERTY.rst b/Help/prop_tgt/include/INTERFACE_BUILD_PROPERTY.rst index 835250be89..6db3f2e22c 100644 --- a/Help/prop_tgt/include/INTERFACE_BUILD_PROPERTY.rst +++ b/Help/prop_tgt/include/INTERFACE_BUILD_PROPERTY.rst @@ -10,7 +10,5 @@ When target dependencies are specified using :command:`target_link_libraries`, CMake will read this property from all target dependencies to determine the build properties of the consumer. -Contents of |PROPERTY_INTERFACE_NAME| 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. +.. |genex_subject| replace:: |PROPERTY_INTERFACE_NAME| +.. include:: /include/GENEX_NOTE.rst diff --git a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst index ffa0a4c7a6..8abbc4678a 100644 --- a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst +++ b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst @@ -17,8 +17,5 @@ model of the project and can break things. See the :prop_tgt:`XCODE_ATTRIBUTE_` target property to set attributes on a specific target. -Contents of ``CMAKE_XCODE_ATTRIBUTE_`` 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. +.. |genex_subject| replace:: ``CMAKE_XCODE_ATTRIBUTE_`` +.. include:: ../include/GENEX_NOTE.rst diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 1146a294cb..4da810002f 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -438,9 +438,10 @@ void cmRST::ProcessDirectiveCodeBlock() void cmRST::ProcessDirectiveReplace() { - // Record markup lines as replacement text. + // Record markup lines as replacement text. Documents processed + // together share one context, so a redefinition must override. std::string& replacement = this->Replace[0][this->ReplaceName]; - replacement += cmJoin(this->MarkupLines, " "); + replacement = cmJoin(this->MarkupLines, " "); this->ReplaceName.clear(); } diff --git a/Tests/CMakeLib/testRST.expect b/Tests/CMakeLib/testRST.expect index 5553dad2cd..21edd7c9df 100644 --- a/Tests/CMakeLib/testRST.expect +++ b/Tests/CMakeLib/testRST.expect @@ -186,3 +186,5 @@ this text is a different length ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Substitutions in headers should cause the header line's length to be updated. + +A second definition uses only the last definition. diff --git a/Tests/CMakeLib/testRST.rst b/Tests/CMakeLib/testRST.rst index e10cd63936..0de64e3e67 100644 --- a/Tests/CMakeLib/testRST.rst +++ b/Tests/CMakeLib/testRST.rst @@ -195,3 +195,8 @@ Testing a |delayed substitution|. .. |header substitution| replace:: this text is a different length Substitutions in headers should cause the header line's length to be updated. + +.. |redefined substitution| replace:: first definition +.. |redefined substitution| replace:: second definition + +A |redefined substitution| uses only the last definition.