Browse Source

Detect Intel compiler version with its id (#11937)

Decode decimal digits from

  __INTEL_COMPILER
  __INTEL_COMPILER_BUILD_DATE

to compute the version number components.  See documentation at:

  http://predef.sourceforge.net/precomp.html
  http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/fortran/lin/compiler_f/bldaps_for/common/bldaps_use_presym.htm
Brad King 14 years ago
parent
commit
2cc205a0fb
2 changed files with 12 additions and 0 deletions
  1. 6 0
      Modules/CMakeCCompilerId.c.in
  2. 6 0
      Modules/CMakeCXXCompilerId.cpp.in

+ 6 - 0
Modules/CMakeCCompilerId.c.in

@@ -8,6 +8,12 @@
 
 #if defined(__INTEL_COMPILER) || defined(__ICC)
 # define COMPILER_ID "Intel"
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER    % 10)
+# if defined(__INTEL_COMPILER_BUILD_DATE)
+#  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
+# endif
 
 #elif defined(__clang__)
 # define COMPILER_ID "Clang"

+ 6 - 0
Modules/CMakeCXXCompilerId.cpp.in

@@ -10,6 +10,12 @@
 
 #elif defined(__INTEL_COMPILER) || defined(__ICC)
 # define COMPILER_ID "Intel"
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER    % 10)
+# if defined(__INTEL_COMPILER_BUILD_DATE)
+#  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
+# endif
 
 #elif defined(__clang__)
 # define COMPILER_ID "Clang"