[Cmake-commits] CMake branch, next, updated. v3.5.1-816-g576f741

Brad King brad.king at kitware.com
Tue Apr 5 09:50:57 EDT 2016


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  576f741379fcd9201791204619ad01d13c908903 (commit)
       via  8c4f100a56619bf115115d0bcaa322c422f0c44f (commit)
       via  66fa61439db3043e903074a526aa2200e9766dcc (commit)
      from  3a8811f9c69a5ca9c441e79c0c3c790670dc1066 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=576f741379fcd9201791204619ad01d13c908903
commit 576f741379fcd9201791204619ad01d13c908903
Merge: 3a8811f 8c4f100
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 5 09:50:56 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 5 09:50:56 2016 -0400

    Merge topic 'mingw-w64-Fortran-platform' into next
    
    8c4f100a Fortran: Fix platform id detection on mingw-w64
    66fa6143 CMakeDetermineFortranCompiler: Modernize conventions


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c4f100a56619bf115115d0bcaa322c422f0c44f
commit 8c4f100a56619bf115115d0bcaa322c422f0c44f
Author:     Melven Roehrig-Zoellner <Melven.Roehrig-Zoellner at DLR.de>
AuthorDate: Sun Apr 3 23:01:22 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 5 09:50:14 2016 -0400

    Fortran: Fix platform id detection on mingw-w64
    
    On mingw-w64 the GNU Fortran compiler does not define `__MINGW32__` or
    any similar indicator.  Fix `CMAKE_Fortran_PLATFORM_ID` detection in
    this case by falling back to preprocessing a `.c` source file even
    when the compiler id is already detected.

diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 1baca29..4f2a70c 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -209,6 +209,21 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
     endif()
   endif()
 
+  # Fall back for GNU MINGW, which is not always detected correctly
+  # (__MINGW32__ is defined for the C language, but perhaps not for Fortran!)
+  if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_Fortran_PLATFORM_ID)
+    execute_process(COMMAND ${CMAKE_Fortran_COMPILER} ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "${CMAKE_ROOT}/Modules/CMakeTestGNU.c"
+      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RESULT_VARIABLE CMAKE_COMPILER_RETURN)
+    if(NOT CMAKE_COMPILER_RETURN)
+      if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_MINGW")
+        set(CMAKE_Fortran_PLATFORM_ID "MinGW")
+      endif()
+      if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_CYGWIN")
+        set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
+      endif()
+    endif()
+  endif()
+
   # Set old compiler and platform id variables.
   if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
     set(CMAKE_COMPILER_IS_GNUG77 1)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=66fa61439db3043e903074a526aa2200e9766dcc
commit 66fa61439db3043e903074a526aa2200e9766dcc
Author:     Melven Roehrig-Zoellner <Melven.Roehrig-Zoellner at DLR.de>
AuthorDate: Sun Apr 3 23:01:22 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 5 09:44:09 2016 -0400

    CMakeDetermineFortranCompiler: Modernize conventions
    
    Suggested-by: Ben Boeckel <ben.boeckel at kitware.com>

diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index ccafb07..1baca29 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -185,11 +185,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
 
   # Fall back to old is-GNU test.
   if(NOT CMAKE_Fortran_COMPILER_ID)
-    exec_program(${CMAKE_Fortran_COMPILER}
-      ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
-      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
+    execute_process(COMMAND ${CMAKE_Fortran_COMPILER} ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "${CMAKE_ROOT}/Modules/CMakeTestGNU.c"
+      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RESULT_VARIABLE CMAKE_COMPILER_RETURN)
     if(NOT CMAKE_COMPILER_RETURN)
-      if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_GNU")
+      if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_GNU")
         set(CMAKE_Fortran_COMPILER_ID "GNU")
         file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
           "Determining if the Fortran compiler is GNU succeeded with "
@@ -200,10 +199,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
           "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
       endif()
       if(NOT CMAKE_Fortran_PLATFORM_ID)
-        if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_MINGW")
+        if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_MINGW")
           set(CMAKE_Fortran_PLATFORM_ID "MinGW")
         endif()
-        if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_CYGWIN")
+        if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_CYGWIN")
           set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
         endif()
       endif()

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

Summary of changes:
 Modules/CMakeDetermineFortranCompiler.cmake |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list