2009-12-14 20:36:25 +03:00
|
|
|
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@"
|
2013-02-06 01:10:36 +04:00
|
|
|
-T "@CMAKE_TEST_GENERATOR_TOOLSET@"
|
2009-12-14 20:36:25 +03:00
|
|
|
"-DFortranC_TEST_FLAGS=1"
|
|
|
|
"-DCMAKE_C_COMPILER=${bld}/cc.sh"
|
2009-12-15 22:03:03 +03:00
|
|
|
"-DCMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@"
|
2009-12-14 20:36:25 +03:00
|
|
|
"-DCMAKE_Fortran_COMPILER=${bld}/fc.sh"
|
2009-12-15 22:03:03 +03:00
|
|
|
"-DCMAKE_Fortran_FLAGS:STRING=@CMAKE_Fortran_FLAGS@"
|
2009-12-14 20:36:25 +03:00
|
|
|
RESULT_VARIABLE result
|
|
|
|
)
|
|
|
|
|
|
|
|
if(NOT "${result}" STREQUAL "0")
|
|
|
|
message(FATAL_ERROR "Configuration failed: ${result}")
|
|
|
|
endif()
|