summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCCompilerId.c.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-06 16:56:51 (GMT)
committerBrad King <brad.king@kitware.com>2011-12-07 13:59:53 (GMT)
commita6d83ccea9075af783b91f86c37af1f4ec11b5bd (patch)
treebf74551d0d16ae6b39821b89dbfb44ad8e8648cb /Modules/CMakeCCompilerId.c.in
parenta66285583d5d5426ead606dd1175f0c6d664ce47 (diff)
downloadCMake-a6d83ccea9075af783b91f86c37af1f4ec11b5bd.zip
CMake-a6d83ccea9075af783b91f86c37af1f4ec11b5bd.tar.gz
CMake-a6d83ccea9075af783b91f86c37af1f4ec11b5bd.tar.bz2
Detect MSVC compiler version with its id
Decode decimal digits from _MSC_VER, _MSC_FULL_VER, and _MSC_BUILD to compute the version number components. See documentation at: http://msdn.microsoft.com/en-us/library/b0084kay.aspx http://predef.sourceforge.net/precomp.html
Diffstat (limited to 'Modules/CMakeCCompilerId.c.in')
-rw-r--r--Modules/CMakeCCompilerId.c.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 25e4947..7a76897 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -61,6 +61,18 @@
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
+# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
+# if defined(_MSC_FULL_VER)
+# if _MSC_VER >= 1400
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
+# else
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
+# endif
+# endif
+# if defined(_MSC_BUILD)
+# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
+# endif
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and