Visual Studio 16 2019.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Visual Studio 16 2019
  2. ---------------------
  3. .. versionadded:: 3.14
  4. Generates Visual Studio 16 (VS 2019) project files.
  5. Project Types
  6. ^^^^^^^^^^^^^
  7. Only Visual C++ and C# projects may be generated. Other types of
  8. projects (JavaScript, Powershell, Python, etc.) are not supported.
  9. Instance Selection
  10. ^^^^^^^^^^^^^^^^^^
  11. VS 2019 supports multiple installations on the same machine.
  12. The :variable:`CMAKE_GENERATOR_INSTANCE` variable may be set as a
  13. cache entry containing the absolute path to a Visual Studio instance.
  14. If the value is not specified explicitly by the user or a toolchain file,
  15. CMake queries the Visual Studio Installer to locate VS instances, chooses
  16. one, and sets the variable as a cache entry to hold the value persistently.
  17. When CMake first chooses an instance, if the ``VS160COMNTOOLS`` environment
  18. variable is set and points to the ``Common7/Tools`` directory within
  19. one of the instances, that instance will be used. Otherwise, if more
  20. than one instance is installed we do not define which one is chosen
  21. by default.
  22. Platform Selection
  23. ^^^^^^^^^^^^^^^^^^
  24. The default target platform name (architecture) is that of the host
  25. and is provided in the :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable.
  26. The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
  27. via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
  28. name (architecture). For example:
  29. * ``cmake -G "Visual Studio 16 2019" -A Win32``
  30. * ``cmake -G "Visual Studio 16 2019" -A x64``
  31. * ``cmake -G "Visual Studio 16 2019" -A ARM``
  32. * ``cmake -G "Visual Studio 16 2019" -A ARM64``
  33. Toolset Selection
  34. ^^^^^^^^^^^^^^^^^
  35. The ``v142`` toolset that comes with Visual Studio 16 2019 is selected by
  36. default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
  37. via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
  38. .. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
  39. By default this generator uses the 64-bit variant on x64 hosts and
  40. the 32-bit variant otherwise.
  41. .. include:: VS_TOOLSET_HOST_ARCH.txt