summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCXXCompilerId.cpp.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-06 16:56:43 (GMT)
committerBrad King <brad.king@kitware.com>2011-12-07 13:59:52 (GMT)
commita66285583d5d5426ead606dd1175f0c6d664ce47 (patch)
tree43f66eb483850399423c98506da4d1cc4d116849 /Modules/CMakeCXXCompilerId.cpp.in
parentfa7141f5ad9bc084fefbb898c6cdda9312c5f615 (diff)
downloadCMake-a66285583d5d5426ead606dd1175f0c6d664ce47.zip
CMake-a66285583d5d5426ead606dd1175f0c6d664ce47.tar.gz
CMake-a66285583d5d5426ead606dd1175f0c6d664ce47.tar.bz2
Detect GNU compiler version with its id (#6251)
Decode decimal digits from __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ to compute version components. See documentation at http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html http://predef.sourceforge.net/precomp.html
Diffstat (limited to 'Modules/CMakeCXXCompilerId.cpp.in')
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 469290e..6494c27 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -55,6 +55,11 @@
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
+# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
+# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
+# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"