Commit 66fa6143 authored by Melven Roehrig-Zoellner's avatar Melven Roehrig-Zoellner Committed by Brad King

CMakeDetermineFortranCompiler: Modernize conventions

Suggested-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
parent 73efdd46
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment