runtest.cmake.in 813 B

1234567891011121314151617181920212223
  1. get_filename_component(MINGW_PATH "@MINGW_GFORTRAN@" PATH)
  2. if(NOT EXISTS "${MINGW_PATH}")
  3. set(test_exe
  4. "@VSGNUFortran_BINARY_DIR@/bin/c_using_fortran@CMAKE_EXECUTABLE_SUFFIX@")
  5. message("run: ${test_exe}")
  6. execute_process(COMMAND "${test_exe}"
  7. RESULT_VARIABLE res)
  8. if(NOT "${res}" EQUAL 0)
  9. message(FATAL_ERROR "${test_exe} returned a non 0 value")
  10. endif()
  11. return()
  12. endif()
  13. file(TO_NATIVE_PATH "${MINGW_PATH}" MINGW_PATH)
  14. string(REPLACE "\\" "\\\\" MINGW_PATH "${MINGW_PATH}")
  15. message("${MINGW_PATH}")
  16. set(test_exe "@VSGNUFortran_BINARY_DIR@/bin/c_using_fortran.exe")
  17. set(ENV{PATH} "${MINGW_PATH};$ENV{PATH}")
  18. message("run ${test_exe}")
  19. execute_process(COMMAND "${test_exe}"
  20. RESULT_VARIABLE res)
  21. if(NOT "${res}" EQUAL 0)
  22. message(FATAL_ERROR "${test_exe} returned a non 0 value")
  23. endif()