VS_SETTINGS.rst 964 B

1234567891011121314151617181920212223242526272829303132333435
  1. VS_SETTINGS
  2. -----------
  3. .. versionadded:: 3.18
  4. Add arbitrary MSBuild item metadata to a file.
  5. This property accepts a list of ``Key=Value`` pairs. The Visual Studio
  6. generator will add these key-value pairs as item metadata to the file.
  7. :manual:`Generator expressions <cmake-generator-expressions(7)>` are supported.
  8. For example:
  9. .. code-block:: cmake
  10. set_property(SOURCE file.hlsl PROPERTY VS_SETTINGS "Key=Value" "Key2=Value2")
  11. will set the ``file.hlsl`` item metadata as follows:
  12. .. code-block:: xml
  13. <FXCompile Include="source_path\file.hlsl">
  14. <Key>Value</Key>
  15. <Key2>Value2</Key2>
  16. </FXCompile>
  17. Together with :prop_sf:`VS_TOOL_OVERRIDE`, this property can be used to
  18. configure items for custom MSBuild tasks.
  19. Adding the metadata ``ExcludedFromBuild=true`` will exclude the file from
  20. the build.
  21. .. versionchanged:: 3.22
  22. This property is honored for all source file types.
  23. Previously, it only worked for source types unknown to CMake.