diff --git a/Help/prop_sf/VS_SETTINGS.rst b/Help/prop_sf/VS_SETTINGS.rst index 871e36e855..da85f121a7 100644 --- a/Help/prop_sf/VS_SETTINGS.rst +++ b/Help/prop_sf/VS_SETTINGS.rst @@ -3,15 +3,11 @@ VS_SETTINGS .. versionadded:: 3.18 -Set any item metadata on a file. +Add arbitrary MSBuild item metadata to a file. -.. versionadded:: 3.22 - - This property is honored for all source file types. - Previously it worked only for non-built files. - -Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator to set -``Key`` to ``Value`` as item metadata on the file. +This property accepts a list of ``Key=Value`` pairs. The Visual Studio +generator will add these key-value pairs as item metadata to the file. +:manual:`Generator expressions ` are supported. For example: @@ -19,7 +15,21 @@ For example: set_property(SOURCE file.hlsl PROPERTY VS_SETTINGS "Key=Value" "Key2=Value2") -will set ``Key`` to ``Value`` and ``Key2`` to ``Value2`` on the -``file.hlsl`` item as metadata. +will set the ``file.hlsl`` item metadata as follows: -:manual:`Generator expressions ` are supported. +.. code-block:: xml + + + Value + Value2 + + +Together with :prop_sf:`VS_TOOL_OVERRIDE`, this property can be used to +configure items for custom MSBuild tasks. + +Adding the metadata ``ExcludedFromBuild=true`` will exclude the file from +the build. + +.. versionchanged:: 3.22 + This property is honored for all source file types. + Previously, it only worked for source types unknown to CMake. diff --git a/Help/prop_sf/VS_TOOL_OVERRIDE.rst b/Help/prop_sf/VS_TOOL_OVERRIDE.rst index b2f41120fd..57172b6660 100644 --- a/Help/prop_sf/VS_TOOL_OVERRIDE.rst +++ b/Help/prop_sf/VS_TOOL_OVERRIDE.rst @@ -3,5 +3,13 @@ VS_TOOL_OVERRIDE .. versionadded:: 3.7 -Override the default Visual Studio tool that will be applied to the source file -with a new tool not based on the extension of the file. +Override the MSBuild item type of a source file in a Visual Studio project. + +Together with :prop_sf:`VS_SETTINGS`, this property can be used to configure +items for custom MSBuild tasks. + +Setting the item type to ``None`` will exclude the file from the build. + +.. versionchanged:: 3.31 + This property is honored for all source file types. + Previously, it only worked for source types unknown to CMake.