diff options
author | Brad King <brad.king@kitware.com> | 2009-12-15 19:03:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-12-15 19:03:03 (GMT) |
commit | 1ac1058272b03fee1e4f5ca1de0fd46453a8b125 (patch) | |
tree | 8009c494a3cbac165496ff1f4962bdbdd7bdb176 /Tests/CheckFortran.cmake | |
parent | 0306080e6e11620f3b36ee515078f389bc00e4f3 (diff) | |
download | CMake-1ac1058272b03fee1e4f5ca1de0fd46453a8b125.zip CMake-1ac1058272b03fee1e4f5ca1de0fd46453a8b125.tar.gz CMake-1ac1058272b03fee1e4f5ca1de0fd46453a8b125.tar.bz2 |
Honor real language flags in FortranC.Flags test
The test overrides the CMAKE_C_FLAGS and CMAKE_Fortran_FLAGS to test
passing a specific flag to the compiler wrapper scripts. We fix it to
honor any outside flags needed for the real compiler.
Diffstat (limited to 'Tests/CheckFortran.cmake')
-rw-r--r-- | Tests/CheckFortran.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake index cf47576..8adcafc 100644 --- a/Tests/CheckFortran.cmake +++ b/Tests/CheckFortran.cmake @@ -15,11 +15,14 @@ if(NOT DEFINED CMAKE_Fortran_COMPILER) set(_desc "Looking for a Fortran compiler") message(STATUS ${_desc}) + file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran/CMakeLists.txt" "cmake_minimum_required(VERSION 2.4) project(CheckFortran Fortran) file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" - \"set(CMAKE_Fortran_COMPILER \\\"\${CMAKE_Fortran_COMPILER}\\\")\\n\") + \"set(CMAKE_Fortran_COMPILER \\\"\${CMAKE_Fortran_COMPILER}\\\")\\n\" + \"set(CMAKE_Fortran_FLAGS \\\"\${CMAKE_Fortran_FLAGS}\\\")\\n\" + ) ") execute_process( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran @@ -42,4 +45,6 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" message(STATUS "${_desc} - ${CMAKE_Fortran_COMPILER}") set(CMAKE_Fortran_COMPILER "${CMAKE_Fortran_COMPILER}" CACHE FILEPATH "Fortran compiler") mark_as_advanced(CMAKE_Fortran_COMPILER) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" CACHE STRING "Fortran flags") + mark_as_advanced(CMAKE_Fortran_FLAGS) endif() |