CheckFortranSourceCompiles.cmake 311 B

12345678910111213141516
  1. enable_language (Fortran)
  2. include(CheckSourceCompiles)
  3. set(Fortran 1) # test that this is tolerated
  4. check_source_compiles(Fortran [=[
  5. PROGRAM TEST_HAVE_PRINT
  6. PRINT *, 'Hello'
  7. END
  8. ]=] SHOULD_BUILD)
  9. if(NOT SHOULD_BUILD)
  10. message(SEND_ERROR "Test fail for valid Fortran source.")
  11. endif()