Visual Studio 15 2017.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Visual Studio 15 2017
  2. ---------------------
  3. Generates Visual Studio 15 (VS 2017) 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 2017 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 ``VS150COMNTOOLS`` 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 :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
  24. via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
  25. name (architecture). For example:
  26. * ``cmake -G "Visual Studio 15 2017" -A Win32``
  27. * ``cmake -G "Visual Studio 15 2017" -A x64``
  28. * ``cmake -G "Visual Studio 15 2017" -A ARM``
  29. * ``cmake -G "Visual Studio 15 2017" -A ARM64``
  30. For compatibility with CMake versions prior to 3.1, one may specify
  31. a target platform name optionally at the end of the generator name.
  32. This is supported only for:
  33. ``Visual Studio 15 2017 Win64``
  34. Specify target platform ``x64``.
  35. ``Visual Studio 15 2017 ARM``
  36. Specify target platform ``ARM``.
  37. Toolset Selection
  38. ^^^^^^^^^^^^^^^^^
  39. The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by
  40. default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
  41. via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
  42. .. include:: VS_TOOLSET_HOST_ARCH.txt