diff options
author | Brad King <brad.king@kitware.com> | 2014-04-11 13:13:16 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-04-11 13:13:16 (GMT) |
commit | a6fee73dacdb8bd6e0eeee9e238a81b62ba303e1 (patch) | |
tree | bc6a2f2d5ba5b13dee98124340df926adbc0f216 /Modules | |
parent | 893843ce21451d7cb8f1aaf3ae14477bfc351fa8 (diff) | |
parent | f0de3f80bb573b46a803094226ae9e5f1d5e1fbc (diff) | |
download | CMake-a6fee73dacdb8bd6e0eeee9e238a81b62ba303e1.zip CMake-a6fee73dacdb8bd6e0eeee9e238a81b62ba303e1.tar.gz CMake-a6fee73dacdb8bd6e0eeee9e238a81b62ba303e1.tar.bz2 |
Merge topic 'CMakeDetermineVSServicePack-vs-11-update-4'
f0de3f80 CMakeDetermineVSServicePack: Add VS 11 update 4
105658df CMakeDetermineVSServicePack: Match versions more robustly
101515b9 CMakeDetermineVSServicePack: Format documentation
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineVSServicePack.cmake | 58 |
1 files changed, 17 insertions, 41 deletions
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake index 353aed6..2854387 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() |