diff options
author | Brad King <brad.king@kitware.com> | 2018-04-05 17:26:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-04-05 17:26:49 (GMT) |
commit | 308d21b225af15c52806b6a2d601cb2f06d42629 (patch) | |
tree | 5c473b675453f633dcb6fc4237bd4cd9b65abe15 /Modules/Platform | |
parent | 43e44bcd8e14783ff454f70d097cfa9fa8aef652 (diff) | |
parent | 45bf6f6246a72874c880aa3de13ba957abd50ca6 (diff) | |
download | CMake-308d21b225af15c52806b6a2d601cb2f06d42629.zip CMake-308d21b225af15c52806b6a2d601cb2f06d42629.tar.gz CMake-308d21b225af15c52806b6a2d601cb2f06d42629.tar.bz2 |
Merge topic 'msvc-toolset-version-variable'
45bf6f6246 Modules: Use MSVC_TOOLSET_VERSION variable to simplify logic
304f493e57 MSVC: Add MSVC_TOOLSET_VERSION variable
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1882
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index a1f54c0..ae180ed 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -71,6 +71,31 @@ if(NOT MSVC_VERSION) message(FATAL_ERROR "MSVC compiler version not detected properly: ${_compiler_version}") endif() + if(MSVC_VERSION GREATER_EQUAL 1910) + # VS 2017 or greater + set(MSVC_TOOLSET_VERSION 141) + elseif(MSVC_VERSION EQUAL 1900) + # VS 2015 + set(MSVC_TOOLSET_VERSION 140) + elseif(MSVC_VERSION EQUAL 1800) + # VS 2013 + set(MSVC_TOOLSET_VERSION 120) + elseif(MSVC_VERSION EQUAL 1700) + # VS 2012 + set(MSVC_TOOLSET_VERSION 110) + elseif(MSVC_VERSION EQUAL 1600) + # VS 2010 + set(MSVC_TOOLSET_VERSION 100) + elseif(MSVC_VERSION EQUAL 1500) + # VS 2008 + set(MSVC_TOOLSET_VERSION 90) + elseif(MSVC_VERSION EQUAL 1400) + # VS 2005 + set(MSVC_TOOLSET_VERSION 80) + else() + # We don't support MSVC_TOOLSET_VERSION for earlier compiler. + endif() + set(MSVC10) set(MSVC11) set(MSVC12) |