diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-11-03 17:15:59 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-11-03 17:15:59 (GMT) |
commit | a1f1e501434560d092fc897825e213273e448648 (patch) | |
tree | 261fd8535e973f0a2f3226444c557901eb37ace9 /Tests/Fortran | |
parent | 093e5157a9b800e512c5db64bcba8c4f07f6b31b (diff) | |
download | CMake-a1f1e501434560d092fc897825e213273e448648.zip CMake-a1f1e501434560d092fc897825e213273e448648.tar.gz CMake-a1f1e501434560d092fc897825e213273e448648.tar.bz2 |
ENH: only allow matching fortran a c compilers to be used
Diffstat (limited to 'Tests/Fortran')
-rw-r--r-- | Tests/Fortran/CMakeLists.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index e70b2f1..7169ce6 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required (VERSION 2.6) PROJECT(testf C Fortran) +message("CTEST_FULL_OUTPUT ") SET(CMAKE_VERBOSE_MAKEFILE 1) MESSAGE("ENV_FLAGS = $ENV{FFLAGS}") MESSAGE("CMAKE_Fortran_COMPILER_INIT = ${CMAKE_Fortran_COMPILER_INIT}") @@ -29,9 +30,17 @@ set(FORTRAN_FUNCTIONS ${FORTRAN_FUNCTIONS} my_sub mysub ) set(srcs ${srcs} mysub.f foo.c) create_fortran_c_interface("F_" FORTRAN_FUNCTIONS "${testf_BINARY_DIR}/foo.h") include_directories("${testf_BINARY_DIR}") -add_executable(foo ${srcs}) + +if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "${CMAKE_C_COMPILER_ID}" ) + message("Fortran = ${CMAKE_Fortran_COMPILER_ID}") + message("C = ${CMAKE_C_COMPILER_ID}") + add_executable(foo ${srcs}) +else() + message("Fortran does not match c compiler") + message("Fortran = ${CMAKE_Fortran_COMPILER_ID}") + message("C = ${CMAKE_C_COMPILER_ID}") +endif() # print out some stuff to help debug on machines via cdash -message("CTEST_FULL_OUTPUT ") file(READ "${testf_BINARY_DIR}/foo.h" fooh) message("foo.h contents:\n${fooh}") |