CMakeDetermineVSServicePack¶
Deprecated since version 3.0: This module should no longer be used. The functionality of this module has
been superseded by the CMAKE_<LANG>_COMPILER_VERSION
variable that
contains the compiler version number.
This module provides a function to determine the installed Visual Studio service pack version for Visual Studio 2012 and earlier.
- DetermineVSServicePack¶
DetermineVSServicePack(<result>)
Determines the Visual Studio service pack version of the
cl
compiler in use and stores the result in the specified internal cache variable<result>
.The
<result>
variable will be set to one of the following values or an empty string if the service pack cannot be determined:vc80
,vc80sp1
vc90
,vc90sp1
vc100
,vc100sp1
vc110
,vc110sp1
,vc110sp2
,vc110sp3
,vc110sp4
Examples¶
Determining the Visual Studio service pack version in a project:
if(MSVC)
include(CMakeDetermineVSServicePack)
DetermineVSServicePack(my_service_pack)
if(my_service_pack)
message(STATUS "Detected: ${my_service_pack}")
endif()
endif()