Visual Studio 16 2019.rst 2.0 KB

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