diff options
author | Brad King <brad.king@kitware.com> | 2010-01-28 21:48:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-01-28 21:48:20 (GMT) |
commit | dc1d2189ae922be9d6e7f5fde698532db47e46aa (patch) | |
tree | 28ef61aac78f0bdc190a760d53b6cb89b24262cd /Tests/FortranC/Flags.cmake.in | |
parent | 612409e5b01a7e4823bb379ee9e002177793eb75 (diff) | |
download | CMake-dc1d2189ae922be9d6e7f5fde698532db47e46aa.zip CMake-dc1d2189ae922be9d6e7f5fde698532db47e46aa.tar.gz CMake-dc1d2189ae922be9d6e7f5fde698532db47e46aa.tar.bz2 |
CMake 2.8.1-rc1
Diffstat (limited to 'Tests/FortranC/Flags.cmake.in')
-rw-r--r-- | Tests/FortranC/Flags.cmake.in | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Tests/FortranC/Flags.cmake.in b/Tests/FortranC/Flags.cmake.in new file mode 100644 index 0000000..0b82f0e --- /dev/null +++ b/Tests/FortranC/Flags.cmake.in @@ -0,0 +1,28 @@ +set(src "@CMAKE_CURRENT_SOURCE_DIR@/FortranC") +set(bld "@CMAKE_CURRENT_BINARY_DIR@/FortranC/Flags") + +# Create wrapper scripts for the compilers that check for expected +# flags, remove them, and invoke the real compiler. +set(ID "CC") +set(COMMAND "@CMAKE_C_COMPILER@") +configure_file("${src}/test_opt.sh.in" "${bld}/cc.sh" @ONLY) +set(ID "FC") +set(COMMAND "@CMAKE_Fortran_COMPILER@") +configure_file("${src}/test_opt.sh.in" "${bld}/fc.sh" @ONLY) +set(ID) +set(COMMAND) + +execute_process( + WORKING_DIRECTORY "${bld}" + COMMAND ${CMAKE_COMMAND} "${src}" -G "@CMAKE_TEST_GENERATOR@" + "-DFortranC_TEST_FLAGS=1" + "-DCMAKE_C_COMPILER=${bld}/cc.sh" + "-DCMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@" + "-DCMAKE_Fortran_COMPILER=${bld}/fc.sh" + "-DCMAKE_Fortran_FLAGS:STRING=@CMAKE_Fortran_FLAGS@" + RESULT_VARIABLE result + ) + +if(NOT "${result}" STREQUAL "0") + message(FATAL_ERROR "Configuration failed: ${result}") +endif() |