External download workaround

This commit is contained in:
Andrew A. Vasilyev 2019-05-17 13:30:49 +03:00
parent 2f7cee5bcf
commit b3413feddb
2 changed files with 22 additions and 22 deletions

View File

@ -4,29 +4,29 @@ function(download_external PCKG_NAME PCKG_DIR_NAME PCKG_URL)
set(${PCKG_NAME}_DIR_NAME ${PCKG_DIR_NAME} CACHE INTERNAL "" FORCE)
if(NOT IS_DIRECTORY ${CMAKE_SOURCE_DIR}/external/${PCKG_DIR_NAME})
message(STATUS "Downloading ${PCKG_URL}...")
if(ARGV3)
file(DOWNLOAD
${PCKG_URL}
${CMAKE_BINARY_DIR}/${PCKG_DIR_NAME}.zip
INACTIVITY_TIMEOUT 15
SHOW_PROGRESS
STATUS DOWNLOAD_STATUS
EXPECTED_MD5 ${ARGV3})
else()
file(DOWNLOAD
${PCKG_URL}
${CMAKE_BINARY_DIR}/${PCKG_DIR_NAME}.zip
INACTIVITY_TIMEOUT 15
SHOW_PROGRESS
STATUS DOWNLOAD_STATUS)
endif()
# message(STATUS "Downloading ${PCKG_URL}...")
# if(ARGV3)
# file(DOWNLOAD
# ${PCKG_URL}
# ${CMAKE_BINARY_DIR}/${PCKG_DIR_NAME}.zip
# INACTIVITY_TIMEOUT 15
# SHOW_PROGRESS
# STATUS DOWNLOAD_STATUS
# EXPECTED_MD5 ${ARGV3})
# else()
# file(DOWNLOAD
# ${PCKG_URL}
# ${CMAKE_BINARY_DIR}/${PCKG_DIR_NAME}.zip
# INACTIVITY_TIMEOUT 15
# SHOW_PROGRESS
# STATUS DOWNLOAD_STATUS)
# endif()
list(GET DOWNLOAD_STATUS 0 DOWNLOAD_CODE)
if(NOT DOWNLOAD_CODE EQUAL 0)
list(GET DOWNLOAD_STATUS 1 DOWNLOAD_MESSAGE)
message(FATAL_ERROR "Download ${PCKG_URL} error ${DOWNLOAD_CODE}: ${DOWNLOAD_MESSAGE}")
endif()
# list(GET DOWNLOAD_STATUS 0 DOWNLOAD_CODE)
# if(NOT DOWNLOAD_CODE EQUAL 0)
# list(GET DOWNLOAD_STATUS 1 DOWNLOAD_MESSAGE)
# message(FATAL_ERROR "Download ${PCKG_URL} error ${DOWNLOAD_CODE}: ${DOWNLOAD_MESSAGE}")
# endif()
message(STATUS "Unpacking ${PCKG_DIR_NAME}.zip ...")
execute_process(COMMAND unzip -q ${CMAKE_BINARY_DIR}/${PCKG_DIR_NAME}.zip

BIN
external/v0.14.0.zip vendored Normal file

Binary file not shown.