Last active
August 29, 2015 14:01
-
-
Save jcfr/a9ceafe9e794b033d433 to your computer and use it in GitHub Desktop.
Short CMake script attempting to download Python-2.7.3.tgz. It has been created in an attempt to reproduce issue discussed here: http://slicer-devel.65872.n3.nabble.com/Problems-downloading-packages-on-Windows-during-Slicer-build-tt4031572.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set(file "./Python-2.7.3.tgz") | |
message(STATUS "Removing ${file}") | |
file(REMOVE ${file}) | |
message(STATUS "Removing ${file} - done") | |
message(STATUS "Downloading ${file}") | |
file( | |
DOWNLOAD https://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz ${file} | |
SHOW_PROGRESS | |
STATUS status | |
) | |
list(GET status 0 error_code) | |
list(GET status 1 error_msg) | |
if(error_code) | |
message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}") | |
endif() | |
message(STATUS "Downloading ${file} - done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To execute the script: