From 707aefd853d1fec2960058e2e921e5d24c736526 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 22 Aug 2012 10:15:00 -0400 Subject: [PATCH] Detect Compaq compiler version with its id Decode decimal digits from __DECC_VER and __DECCXX_VER to compute version number components. See documentation at: http://www.openvms.compaq.com/commercial/c/docs/5492p024.html#decc_ver_sec http://www.tru64unix.compaq.com/cplus/ugu_impl.html#predef_vernum http://sourceforge.net/p/predef/wiki/Compilers/#compaq-cchttpwwwopenvmscompaqcomopenvmsbrochuresdeccplus --- Modules/CMakeCCompilerId.c.in | 4 ++++ Modules/CMakeCXXCompilerId.cpp.in | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 06aa9bf06..7771dbf25 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -67,6 +67,10 @@ #elif defined(__DECC) # define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) #elif defined(__IBMC__) # if defined(__COMPILER_VER__) diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 95fc852d6..47cd45c32 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -69,6 +69,10 @@ #elif defined(__DECCXX) # define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) #elif defined(__IBMCPP__) # if defined(__COMPILER_VER__)