summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/MSVC-DetermineCompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-08 15:27:51 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-05-08 15:27:51 (GMT)
commit6eafe843ca632eadd896cca95c42420b48e2a9a2 (patch)
treed2de32f2a5dadc92de59ea1e6631682e7aecb33f /Modules/Compiler/MSVC-DetermineCompiler.cmake
parentd02e58c4709c76bd19aeeac29cb845dc91aebf11 (diff)
parent3b59f8b7c68127c649fd72983e6f0a24cbb51427 (diff)
downloadCMake-6eafe843ca632eadd896cca95c42420b48e2a9a2.zip
CMake-6eafe843ca632eadd896cca95c42420b48e2a9a2.tar.gz
CMake-6eafe843ca632eadd896cca95c42420b48e2a9a2.tar.bz2
Merge topic 'compiler-id-refactor'
3b59f8b7 Project: Refactor C compiler determination into multiple files. 8896501b CompilerId: Allow specifying a prefix for preprocessor defines. 23f451bb CompilerId: Guard the platform-default compiler code with a parameter. 30a99f5c CompilerId: Add option to generate compiler-id-specific defines. 36ed5894 CompilerId: Allow specifying the compiler-specific components to generate. 9a083bce Project: Split the compiler id detection into a separate function. 9d285600 Project: Generate the CXX compiler Id test from multiple files.
Diffstat (limited to 'Modules/Compiler/MSVC-DetermineCompiler.cmake')
-rw-r--r--Modules/Compiler/MSVC-DetermineCompiler.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/Modules/Compiler/MSVC-DetermineCompiler.cmake b/Modules/Compiler/MSVC-DetermineCompiler.cmake
new file mode 100644
index 0000000..d462d07
--- /dev/null
+++ b/Modules/Compiler/MSVC-DetermineCompiler.cmake
@@ -0,0 +1,19 @@
+
+set(_compiler_id_pp_test "defined(_MSC_VER)")
+
+set(_compiler_id_version_compute "
+ /* _MSC_VER = VVRR */
+# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define @PREFIX@COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
+# if defined(_MSC_FULL_VER)
+# if _MSC_VER >= 1400
+ /* _MSC_FULL_VER = VVRRPPPPP */
+# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
+# else
+ /* _MSC_FULL_VER = VVRRPPPP */
+# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
+# endif
+# endif
+# if defined(_MSC_BUILD)
+# define @PREFIX@COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
+# endif")