DOTNET_SDK.rst 966 B

12345678910111213141516171819202122232425
  1. DOTNET_SDK
  2. ----------
  3. .. versionadded:: 3.23
  4. Specify the .NET SDK for C# projects. For example: ``Microsoft.NET.Sdk``.
  5. This property tells :ref:`Visual Studio Generators` for VS 2019 and
  6. above to generate a .NET SDK-style project using the specified SDK.
  7. The property is meaningful only to these generators, and only in C#
  8. targets. It is ignored for C++ projects, even if they are managed
  9. (e.g. using :prop_tgt:`COMMON_LANGUAGE_RUNTIME`).
  10. This property must be a non-empty string to generate .NET SDK-style projects.
  11. CMake does not perform any validations for the value of the property.
  12. This property may be initialized for all targets using the
  13. :variable:`CMAKE_DOTNET_SDK` variable.
  14. .. note::
  15. The :ref:`Visual Studio Generators` in this version of CMake have not
  16. yet learned to support :command:`add_custom_command` in .NET SDK-style
  17. projects. It is currently an error to attach a custom command to a
  18. target with the ``DOTNET_SDK`` property set.