Visual Studio 15 2017.rst 2.3 KB

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