From d7c6f410f98123af03322bd916e49b9e21d90310 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 10 Jan 2012 13:07:04 -0500 Subject: [PATCH] Detect HP compiler version with its id Decode decimal digits from __HP_cc and __HP_aCC to compute version number components. See documentation at: http://predef.sourceforge.net/precomp.html http://g4u0420c.houston.hp.com/en/14487/preprocess.htm --- Modules/CMakeCCompilerId.c.in | 3 +++ Modules/CMakeCXXCompilerId.cpp.in | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 85e26717c..c39eccbb6 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -45,6 +45,9 @@ #elif defined(__HP_cc) # define COMPILER_ID "HP" +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) #elif defined(__DECC) # define COMPILER_ID "Compaq" diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 5f0cb6bab..bf4eaf974 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -47,6 +47,9 @@ #elif defined(__HP_aCC) # define COMPILER_ID "HP" +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) #elif defined(__DECCXX) # define COMPILER_ID "Compaq"