summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-04-10 12:49:54 -0400
committerBrad King <brad.king@kitware.com>2014-04-10 12:49:54 -0400
commit4fd266904c5df846909826437493a00cdc096c5a (patch)
tree9e2489dfc0e751fd2770e311182d2a980b9c5df8
parentc4b31a2c473547306caa63cf8a49d3238125210a (diff)
parentf0de3f80bb573b46a803094226ae9e5f1d5e1fbc (diff)
downloadcmake-4fd266904c5df846909826437493a00cdc096c5a.tar.gz
Merge branch 'CMakeDetermineVSServicePack-vs-11-update-4' into release
-rw-r--r--Modules/CMakeDetermineVSServicePack.cmake58
1 files changed, 17 insertions, 41 deletions
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index 353aed6f01..285438781e 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -2,15 +2,15 @@
# CMakeDetermineVSServicePack
# ---------------------------
#
-# Determine the Visual Studio service pack of the 'cl' in use.
+# Deprecated. Do not use.
#
-# The functionality of this module has been superseded by the platform
-# variable CMAKE_<LANG>_COMPILER_VERSION that contains the compiler
-# version number.
+# The functionality of this module has been superseded by the
+# :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that contains
+# the compiler version number.
#
-# Usage:
+# Determine the Visual Studio service pack of the 'cl' in use.
#
-# ::
+# Usage::
#
# if(MSVC)
# include(CMakeDetermineVSServicePack)
@@ -21,14 +21,12 @@
# endif()
#
# Function DetermineVSServicePack sets the given variable to one of the
-# following values or an empty string if unknown:
-#
-# ::
+# following values or an empty string if unknown::
#
# vc80, vc80sp1
# vc90, vc90sp1
# vc100, vc100sp1
-# vc110, vc110sp1, vc110sp2
+# vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4
#=============================================================================
# Copyright 2009-2013 Kitware, Inc.
@@ -68,6 +66,8 @@ function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
set(_version "vc110sp2")
elseif(${_cl_version} VERSION_EQUAL "17.00.60610.1")
set(_version "vc110sp3")
+ elseif(${_cl_version} VERSION_EQUAL "17.00.61030")
+ set(_version "vc110sp4")
else()
set(_version "")
endif()
@@ -86,27 +86,14 @@ function(_DetermineVSServicePack_FastCheckVersionWithCompiler _SUCCESS_VAR _VER
OUTPUT_QUIET
)
- string(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+"
- _cl_version "${_output}")
-
- if(_cl_version)
- string(REGEX MATCHALL "[0-9]+"
- _cl_version_list "${_cl_version}")
- list(GET _cl_version_list 0 _major)
- list(GET _cl_version_list 1 _minor)
- list(GET _cl_version_list 2 _patch)
- list(GET _cl_version_list 3 _tweak)
-
+ if(_output MATCHES "Compiler Version (([0-9]+)\\.([0-9]+)\\.([0-9]+)(\\.([0-9]+))?)")
+ set(_cl_version ${CMAKE_MATCH_1})
+ set(_major ${CMAKE_MATCH_2})
+ set(_minor ${CMAKE_MATCH_3})
if("${_major}${_minor}" STREQUAL "${MSVC_VERSION}")
- set(_cl_version ${_major}.${_minor}.${_patch}.${_tweak})
- else()
- unset(_cl_version)
- endif()
- endif()
-
- if(_cl_version)
set(${_SUCCESS_VAR} true PARENT_SCOPE)
set(${_VERSION_VAR} ${_cl_version} PARENT_SCOPE)
+ endif()
endif()
endif()
endfunction()
@@ -127,20 +114,9 @@ function(_DetermineVSServicePack_CheckVersionWithTryCompile _SUCCESS_VAR _VERSI
file(REMOVE "${CMAKE_BINARY_DIR}/return0.cc")
- string(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+"
- _cl_version "${_output}")
-
- if(_cl_version)
- string(REGEX MATCHALL "[0-9]+"
- _cl_version_list "${_cl_version}")
-
- list(GET _cl_version_list 0 _major)
- list(GET _cl_version_list 1 _minor)
- list(GET _cl_version_list 2 _patch)
- list(GET _cl_version_list 3 _tweak)
-
+ if(_output MATCHES "Compiler Version (([0-9]+)\\.([0-9]+)\\.([0-9]+)(\\.([0-9]+))?)")
set(${_SUCCESS_VAR} true PARENT_SCOPE)
- set(${_VERSION_VAR} ${_major}.${_minor}.${_patch}.${_tweak} PARENT_SCOPE)
+ set(${_VERSION_VAR} "${CMAKE_MATCH_1}" PARENT_SCOPE)
endif()
endfunction()