[Cmake-commits] CMake branch, next, updated. v3.2.0-rc1-387-gff7bdd5

Brad King brad.king at kitware.com
Tue Feb 17 13:40:22 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ff7bdd5e81b172fb44f6a3b3eb395290becc5e18 (commit)
       via  991325c3003de285ed9d8c9aff320adf32e78f1e (commit)
       via  c28877321f938811323dc22b9b4673e037ac1b2e (commit)
       via  a5b2edbe07ec18054bf3119a3ec62839c017fde3 (commit)
       via  1899e73c3ed168374c027444f899a81d65b64812 (commit)
       via  92f56cce857dcfca4a5e3277128b86318934085c (commit)
       via  1a6191a05d77d90c068b748a455945932e0fdce2 (commit)
       via  aacb3d504383b82d5158ce5daa219dddc8fe1e27 (commit)
       via  e0a190a543eaa44c2eb18d7757fb477ca5f548a3 (commit)
       via  cbab2ff445f83b3af1e3f1063994b53b84a9ffe4 (commit)
       via  7c8e085c2a48e56421df3e77188f65b0c40134c0 (commit)
      from  e0c5b99a7f0b970446633448b32b18d92d063d61 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff7bdd5e81b172fb44f6a3b3eb395290becc5e18
commit ff7bdd5e81b172fb44f6a3b3eb395290becc5e18
Merge: e0c5b99 991325c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:40:21 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 17 13:40:21 2015 -0500

    Merge topic 'compiler-version-Fortran' into next
    
    991325c3 Help: Add notes for topic 'compiler-version-Fortran'
    c2887732 Fortran: Test that CMAKE_Fortran_COMPILER_VERSION is set (#15372)
    a5b2edbe Fortran: Detect G95 compiler version
    1899e73c Fortran: Detect PGI compiler version
    92f56cce Fortran: Detect XL and VisualAge compiler versions
    1a6191a0 Fortran: Detect GNU compiler version
    aacb3d50 Fortran: Detect PathScale compiler version
    e0a190a5 Fortran: Detect SunPro compiler version
    cbab2ff4 Fortran: Detect Intel compiler version
    7c8e085c Fortran: Add infrastructure to detect compiler version (#15372)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=991325c3003de285ed9d8c9aff320adf32e78f1e
commit 991325c3003de285ed9d8c9aff320adf32e78f1e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:38:31 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:39:08 2015 -0500

    Help: Add notes for topic 'compiler-version-Fortran'

diff --git a/Help/release/dev/compiler-version-Fortran.rst b/Help/release/dev/compiler-version-Fortran.rst
new file mode 100644
index 0000000..e10b206
--- /dev/null
+++ b/Help/release/dev/compiler-version-Fortran.rst
@@ -0,0 +1,6 @@
+compiler-version-Fortran
+------------------------
+
+* The version of some Fortran compilers is now detected and stored in the
+  :variable:`CMAKE_Fortran_COMPILER_VERSION <CMAKE_<LANG>_COMPILER_VERSION>`
+  variable.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c28877321f938811323dc22b9b4673e037ac1b2e
commit c28877321f938811323dc22b9b4673e037ac1b2e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:37:23 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:38:59 2015 -0500

    Fortran: Test that CMAKE_Fortran_COMPILER_VERSION is set (#15372)
    
    Update the CMakeOnly.CompilerIdFortran test to require that the variable
    is set instead of just warning.  We already require it for C and CXX.

diff --git a/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
index 3a2bdeb..02e4668 100644
--- a/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
+++ b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
@@ -4,19 +4,11 @@ project(CompilerIdFortran Fortran)
 foreach(v
     CMAKE_Fortran_COMPILER
     CMAKE_Fortran_COMPILER_ID
-    )
-  if(${v})
-    message(STATUS "${v}=[${${v}}]")
-  else()
-    message(SEND_ERROR "${v} not set!")
-  endif()
-endforeach()
-foreach(v
     CMAKE_Fortran_COMPILER_VERSION
     )
   if(${v})
     message(STATUS "${v}=[${${v}}]")
   else()
-    message(WARNING "${v} not set!")
+    message(SEND_ERROR "${v} not set!")
   endif()
 endforeach()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5b2edbe07ec18054bf3119a3ec62839c017fde3
commit a5b2edbe07ec18054bf3119a3ec62839c017fde3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:32:28 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:32:45 2015 -0500

    Fortran: Detect G95 compiler version
    
    The __G95__ and __G95_MINOR__ preprocessor symbols encode the compiler
    version as decimal digits.

diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 98ec7f3..2533d3f 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -47,6 +47,8 @@
         PRINT *, 'INFO:compiler[Cray]'
 #elif defined(__G95__)
         PRINT *, 'INFO:compiler[G95]'
+# define COMPILER_VERSION_MAJOR DEC(__G95__)
+# define COMPILER_VERSION_MINOR DEC(__G95_MINOR__)
 #elif defined(__PATHSCALE__)
         PRINT *, 'INFO:compiler[PathScale]'
 # define COMPILER_VERSION_MAJOR DEC(__PATHCC__)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1899e73c3ed168374c027444f899a81d65b64812
commit 1899e73c3ed168374c027444f899a81d65b64812
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:31:45 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:32:11 2015 -0500

    Fortran: Detect PGI compiler version
    
    Port logic from the "Compiler/PGI-DetermineCompiler" module into
    "CMakeFortranCompilerId.F.in".

diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 4c172a8..98ec7f3 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -79,6 +79,11 @@
 # endif
 #elif defined(__PGI)
         PRINT *, 'INFO:compiler[PGI]'
+# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
+# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+#  define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
+# endif
 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
         PRINT *, 'INFO:compiler[MIPSpro]'
 #       if 0

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92f56cce857dcfca4a5e3277128b86318934085c
commit 92f56cce857dcfca4a5e3277128b86318934085c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:30:19 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:30:55 2015 -0500

    Fortran: Detect XL and VisualAge compiler versions
    
    Port logic from the "Compiler/XL-*-DetermineCompiler" and
    "Compiler/VisualAge-*-DetermineCompiler" modules into
    "CMakeFortranCompilerId.F.in".

diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 14ce395..4c172a8 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -68,8 +68,14 @@
         PRINT *, 'INFO:compiler[zOS]'
 # elif __IBMC__ >= 800
         PRINT *, 'INFO:compiler[XL]'
+#  define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
+#  define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
+#  define COMPILER_VERSION_PATCH DEC(__IBMC__    % 10)
 # else
         PRINT *, 'INFO:compiler[VisualAge]'
+#  define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
+#  define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
+#  define COMPILER_VERSION_PATCH DEC(__IBMC__    % 10)
 # endif
 #elif defined(__PGI)
         PRINT *, 'INFO:compiler[PGI]'

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1a6191a05d77d90c068b748a455945932e0fdce2
commit 1a6191a05d77d90c068b748a455945932e0fdce2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:29:33 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:29:33 2015 -0500

    Fortran: Detect GNU compiler version
    
    Port logic from the "Compiler/GNU-DetermineCompiler" module into
    "CMakeFortranCompilerId.F.in".

diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index fcffaa2..14ce395 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -58,6 +58,11 @@
         PRINT *, 'INFO:compiler[Absoft]'
 #elif defined(__GNUC__)
         PRINT *, 'INFO:compiler[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(__IBMC__)
 # if defined(__COMPILER_VER__)
         PRINT *, 'INFO:compiler[zOS]'

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aacb3d504383b82d5158ce5daa219dddc8fe1e27
commit aacb3d504383b82d5158ce5daa219dddc8fe1e27
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:28:45 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:28:45 2015 -0500

    Fortran: Detect PathScale compiler version
    
    Port logic from the "Compiler/PathScale-DetermineCompiler" module into
    "CMakeFortranCompilerId.F.in".

diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 5e8f646..fcffaa2 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -49,6 +49,11 @@
         PRINT *, 'INFO:compiler[G95]'
 #elif defined(__PATHSCALE__)
         PRINT *, 'INFO:compiler[PathScale]'
+# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
+# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
+# if defined(__PATHCC_PATCHLEVEL__)
+#  define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
+# endif
 #elif defined(__ABSOFT__)
         PRINT *, 'INFO:compiler[Absoft]'
 #elif defined(__GNUC__)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0a190a543eaa44c2eb18d7757fb477ca5f548a3
commit e0a190a543eaa44c2eb18d7757fb477ca5f548a3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:27:22 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:27:51 2015 -0500

    Fortran: Detect SunPro compiler version
    
    Port logic from "Compiler/SunPro-*DetermineCompiler" modules into
    "CMakeFortranCompilerId.F.in".

diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 956576d..5e8f646 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -33,8 +33,16 @@
         PRINT *, 'INFO:simulate_version[013.00]'
 #  endif
 # endif
-#elif defined(__SUNPRO_F90) || defined(__SUNPRO_F95)
+#elif defined(__SUNPRO_F95)
         PRINT *, 'INFO:compiler[SunPro]'
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F95>>8)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F95>>4 & 0xF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F95    & 0xF)
+#elif defined(__SUNPRO_F90)
+        PRINT *, 'INFO:compiler[SunPro]'
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F90>>8)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F90>>4 & 0xF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F90    & 0xF)
 #elif defined(_CRAYFTN)
         PRINT *, 'INFO:compiler[Cray]'
 #elif defined(__G95__)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cbab2ff445f83b3af1e3f1063994b53b84a9ffe4
commit cbab2ff445f83b3af1e3f1063994b53b84a9ffe4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:26:14 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:26:48 2015 -0500

    Fortran: Detect Intel compiler version
    
    Port logic from the "Compiler/Intel-DetermineCompiler" module into
    "CMakeFortranCompilerId.F.in".

diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 955ca85..956576d 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -4,6 +4,17 @@
 #endif
 #if defined(__INTEL_COMPILER) || defined(__ICC)
         PRINT *, 'INFO:compiler[Intel]'
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# if defined(__INTEL_COMPILER_UPDATE)
+#  define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
+# else
+#  define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER   % 10)
+# endif
+# if defined(__INTEL_COMPILER_BUILD_DATE)
+#  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
+# endif
+
 # if defined(_MSC_VER)
         PRINT *, 'INFO:simulate[MSVC]'
 #  if _MSC_VER >= 1800

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c8e085c2a48e56421df3e77188f65b0c40134c0
commit 7c8e085c2a48e56421df3e77188f65b0c40134c0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 17 13:24:31 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 17 13:24:31 2015 -0500

    Fortran: Add infrastructure to detect compiler version (#15372)
    
    Fortran does not offer syntax to compose a string literal at
    preprocessing time from numeric compuations.  Instead encode each digit
    of each component as a separate INFO string and compose them in CMake
    code after extraction.  Support MAJOR, MINOR, PATCH, and TWEAK
    components with up to 8 digits each.

diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index dfed00e..9db38b7 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -409,12 +409,28 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
     # Read the compiler identification string from the executable file.
     set(COMPILER_ID)
     set(COMPILER_VERSION)
+    set(COMPILER_VERSION_MAJOR 0)
+    set(COMPILER_VERSION_MINOR 0)
+    set(COMPILER_VERSION_PATCH 0)
+    set(COMPILER_VERSION_TWEAK 0)
+    set(HAVE_COMPILER_VERSION_MAJOR 0)
+    set(HAVE_COMPILER_VERSION_MINOR 0)
+    set(HAVE_COMPILER_VERSION_PATCH 0)
+    set(HAVE_COMPILER_VERSION_TWEAK 0)
+    set(DIGIT_VALUE_1 1)
+    set(DIGIT_VALUE_2 10)
+    set(DIGIT_VALUE_3 100)
+    set(DIGIT_VALUE_4 1000)
+    set(DIGIT_VALUE_5 10000)
+    set(DIGIT_VALUE_6 100000)
+    set(DIGIT_VALUE_7 1000000)
+    set(DIGIT_VALUE_8 10000000)
     set(PLATFORM_ID)
     set(ARCHITECTURE_ID)
     set(SIMULATE_ID)
     set(SIMULATE_VERSION)
     file(STRINGS ${file}
-      CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 6 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
+      CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 38 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
     set(COMPILER_ID_TWICE)
     foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
       if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]")
@@ -433,6 +449,13 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
         string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}")
         string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
       endif()
+      if("${info}" MATCHES "INFO:compiler_version_([A-Z]+)_digit_([0-9])\\[([0-9])\\]")
+        set(comp ${CMAKE_MATCH_1})
+        set(digit ${CMAKE_MATCH_2})
+        set(value ${CMAKE_MATCH_3})
+        math(EXPR COMPILER_VERSION_${comp} "${COMPILER_VERSION_${comp}} + ${value} * ${DIGIT_VALUE_${digit}}")
+        set(HAVE_COMPILER_VERSION_${comp} 1)
+      endif()
       if("${info}" MATCHES "INFO:simulate\\[([^]\"]*)\\]")
         set(SIMULATE_ID "${CMAKE_MATCH_1}")
       endif()
@@ -445,6 +468,20 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
       endif()
     endforeach()
 
+    # Construct compiler version from components if needed.
+    if(NOT DEFINED COMPILER_VERSION AND HAVE_COMPILER_VERSION_MAJOR)
+      set(COMPILER_VERSION "${COMPILER_VERSION_MAJOR}")
+      if(HAVE_COMPILER_VERSION_MINOR)
+        set(COMPILER_VERSION "${COMPILER_VERSION}.${COMPILER_VERSION_MINOR}")
+        if(HAVE_COMPILER_VERSION_PATCH)
+          set(COMPILER_VERSION "${COMPILER_VERSION}.${COMPILER_VERSION_PATCH}")
+          if(HAVE_COMPILER_VERSION_TWEAK)
+            set(COMPILER_VERSION "${COMPILER_VERSION}.${COMPILER_VERSION_TWEAK}")
+          endif()
+        endif()
+      endif()
+    endif()
+
     # Detect the exact architecture from the PE header.
     if(WIN32)
       # The offset to the PE signature is stored at 0x3c.
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index a4bb86c..3a27127 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -119,6 +119,47 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
   set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
   set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
 
+  set(_version_info "")
+  foreach(m MAJOR MINOR PATCH TWEAK)
+    set(_COMP "_${m}")
+    set(_version_info "${_version_info}
+#if defined(COMPILER_VERSION${_COMP})")
+    foreach(d 1 2 3 4 5 6 7 8)
+      set(_version_info "${_version_info}
+# undef DEC
+# undef HEX
+# define DEC(n) DEC_${d}(n)
+# define HEX(n) HEX_${d}(n)
+# if COMPILER_VERSION${_COMP} == 0
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[0]'
+# elif COMPILER_VERSION${_COMP} == 1
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[1]'
+# elif COMPILER_VERSION${_COMP} == 2
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[2]'
+# elif COMPILER_VERSION${_COMP} == 3
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[3]'
+# elif COMPILER_VERSION${_COMP} == 4
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[4]'
+# elif COMPILER_VERSION${_COMP} == 5
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[5]'
+# elif COMPILER_VERSION${_COMP} == 6
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[6]'
+# elif COMPILER_VERSION${_COMP} == 7
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[7]'
+# elif COMPILER_VERSION${_COMP} == 8
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[8]'
+# elif COMPILER_VERSION${_COMP} == 9
+        PRINT *, 'INFO:compiler_version${_COMP}_digit_${d}[9]'
+# endif
+")
+    endforeach()
+    set(_version_info "${_version_info}
+#endif")
+  endforeach()
+  set(CMAKE_Fortran_COMPILER_ID_VERSION_INFO "${_version_info}")
+  unset(_version_info)
+  unset(_COMP)
+
   # Try to identify the compiler.
   set(CMAKE_Fortran_COMPILER_ID)
   include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 5349505..955ca85 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -134,4 +134,26 @@
         PRINT *, 'INFO:arch[X86]'
 # endif
 #endif
+
+#if 0
+! Encode compiler version digits
+#endif
+#define DEC_8(n) (((n) / 10000000) % 10)
+#define DEC_7(n) (((n) / 1000000)  % 10)
+#define DEC_6(n) (((n) / 100000)   % 10)
+#define DEC_5(n) (((n) / 10000)    % 10)
+#define DEC_4(n) (((n) / 1000)     % 10)
+#define DEC_3(n) (((n) / 100)      % 10)
+#define DEC_2(n) (((n) / 10)       % 10)
+#define DEC_1(n) (((n)    )        % 10)
+#define HEX_8(n) ((n)>>28 & 0xF)
+#define HEX_7(n) ((n)>>24 & 0xF)
+#define HEX_6(n) ((n)>>20 & 0xF)
+#define HEX_5(n) ((n)>>16 & 0xF)
+#define HEX_4(n) ((n)>>12 & 0xF)
+#define HEX_3(n) ((n)>>8  & 0xF)
+#define HEX_2(n) ((n)>>4  & 0xF)
+#define HEX_1(n) ((n)     & 0xF)
+ at CMAKE_Fortran_COMPILER_ID_VERSION_INFO@
+
       END

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/compiler-version-Fortran.rst    |    6 ++
 Modules/CMakeDetermineCompilerId.cmake           |   39 ++++++++++++-
 Modules/CMakeDetermineFortranCompiler.cmake      |   41 ++++++++++++++
 Modules/CMakeFortranCompilerId.F.in              |   66 +++++++++++++++++++++-
 Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt |   10 +---
 5 files changed, 151 insertions(+), 11 deletions(-)
 create mode 100644 Help/release/dev/compiler-version-Fortran.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list