aboutsummaryrefslogtreecommitdiff
path: root/cmake/Download.cmake
blob: 50a77816bcba6f316a4f7dbf32775266a26aac92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
file(
  DOWNLOAD "${URL}" "${FILE}"
  STATUS status
  LOG log
)

list(GET status 0 status_code)
list(GET status 1 status_string)

if(NOT status_code EQUAL 0)
  if(NOT ALLOW_FAILURE)
      message(FATAL_ERROR "error: downloading '${URL}' failed
        status_code: ${status_code}
        status_string: ${status_string}
        log: ${log}
      ")
  endif()
endif()