Merge topic 'doc-prefer-MSVC_VERSION'

fecf8467 Help: Document preference of `MSVC_VERSION` over `MSVC##`
712452e3 Help: Clarify MSVC14 docs w.r.t. VS 2017 v141 toolset
49a60b70 MSVC: Exclude future cl 20+ from MSVC14 variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !609
This commit is contained in:
Brad King 2017-03-23 12:44:55 +00:00 committed by Kitware Robot
commit cfa55fd428
11 changed files with 25 additions and 3 deletions

View File

@ -4,3 +4,5 @@ MSVC
``True`` when using Microsoft Visual C++.
Set to ``true`` when the compiler is some version of Microsoft Visual C++.
See also the :variable:`MSVC_VERSION` variable.

View File

@ -1,5 +1,7 @@
MSVC10
------
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using the Microsoft Visual Studio ``v100`` toolset
(``cl`` version 16) or another compiler that simulates it.

View File

@ -1,5 +1,7 @@
MSVC11
------
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using the Microsoft Visual Studio ``v110`` toolset
(``cl`` version 17) or another compiler that simulates it.

View File

@ -1,5 +1,7 @@
MSVC12
------
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using the Microsoft Visual Studio ``v120`` toolset
(``cl`` version 18) or another compiler that simulates it.

View File

@ -1,5 +1,7 @@
MSVC14
------
``True`` when using the Microsoft Visual Studio ``v140`` toolset
(``cl`` version 19) or another compiler that simulates it.
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using the Microsoft Visual Studio ``v140`` or ``v141``
toolset (``cl`` version 19) or another compiler that simulates it.

View File

@ -1,6 +1,8 @@
MSVC60
------
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using Microsoft Visual C++ 6.0.
Set to ``true`` when the compiler is version 6.0 of Microsoft Visual C++.

View File

@ -1,6 +1,8 @@
MSVC70
------
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using Microsoft Visual C++ 7.0.
Set to ``true`` when the compiler is version 7.0 of Microsoft Visual C++.

View File

@ -1,6 +1,8 @@
MSVC71
------
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using Microsoft Visual C++ 7.1.
Set to ``true`` when the compiler is version 7.1 of Microsoft Visual C++.

View File

@ -1,5 +1,7 @@
MSVC80
------
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using the Microsoft Visual Studio ``v80`` toolset
(``cl`` version 14) or another compiler that simulates it.

View File

@ -1,5 +1,7 @@
MSVC90
------
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using the Microsoft Visual Studio ``v90`` toolset
(``cl`` version 15) or another compiler that simulates it.

View File

@ -78,7 +78,9 @@ if(NOT MSVC_VERSION)
set(MSVC90)
set(CMAKE_COMPILER_2005)
set(CMAKE_COMPILER_SUPPORTS_PDBTYPE)
if(NOT "${_compiler_version}" VERSION_LESS 19)
if(NOT "${_compiler_version}" VERSION_LESS 20)
# We no longer provide per-version variables. Use MSVC_VERSION instead.
elseif(NOT "${_compiler_version}" VERSION_LESS 19)
set(MSVC14 1)
elseif(NOT "${_compiler_version}" VERSION_LESS 18)
set(MSVC12 1)