From de6f88d06f907f4cbaab5462cd079fcd77193e41 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 13 Jul 2009 11:24:01 -0400 Subject: [PATCH] ENH: Create Fortran ABI detection framework This invokes CMakeDetermineCompilerABI.cmake for Fortran at the same place it is already done for C and CXX. --- Modules/CMakeFortranCompilerABI.F | 3 +++ Modules/CMakeTestFortranCompiler.cmake | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Modules/CMakeFortranCompilerABI.F diff --git a/Modules/CMakeFortranCompilerABI.F b/Modules/CMakeFortranCompilerABI.F new file mode 100644 index 000000000..cf8662fb8 --- /dev/null +++ b/Modules/CMakeFortranCompilerABI.F @@ -0,0 +1,3 @@ + PROGRAM CMakeFortranCompilerId + PRINT *, 'ABI Detection Binary' + END diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake index c4e639574..6591c2dff 100644 --- a/Modules/CMakeTestFortranCompiler.cmake +++ b/Modules/CMakeTestFortranCompiler.cmake @@ -34,6 +34,20 @@ ELSE(NOT CMAKE_Fortran_COMPILER_WORKS) "the following output:\n${OUTPUT}\n\n") ENDIF(FORTRAN_TEST_WAS_RUN) SET(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "") + + IF(CMAKE_Fortran_COMPILER_FORCED) + # The compiler configuration was forced by the user. + # Assume the user has configured all compiler information. + ELSE(CMAKE_Fortran_COMPILER_FORCED) + # Try to identify the ABI and configure it into CMakeFortranCompiler.cmake + INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) + CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F) + CONFIGURE_FILE( + ${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake + @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 + ) + ENDIF(CMAKE_Fortran_COMPILER_FORCED) ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS) IF(CMAKE_Fortran_COMPILER_WORKS)