Download.cmake 367 B

12345678910111213141516171819
  1. file(
  2. DOWNLOAD "${URL}" "${FILE}"
  3. STATUS status
  4. LOG log
  5. )
  6. list(GET status 0 status_code)
  7. list(GET status 1 status_string)
  8. if(NOT status_code EQUAL 0)
  9. if(NOT ALLOW_FAILURE)
  10. message(FATAL_ERROR "error: downloading '${URL}' failed
  11. status_code: ${status_code}
  12. status_string: ${status_string}
  13. log: ${log}
  14. ")
  15. endif()
  16. endif()