diff options
author | Brad King <brad.king@kitware.com> | 2014-03-17 15:24:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-17 15:28:05 (GMT) |
commit | 7d35b550605596b441af65e96be320ab7d33acc1 (patch) | |
tree | 01e2f69b312a9b90a5fc68313f9d6ce8631d5e78 | |
parent | fb4aff058d2595078300b682dc477f0ccba6d31b (diff) | |
download | CMake-7d35b550605596b441af65e96be320ab7d33acc1.zip CMake-7d35b550605596b441af65e96be320ab7d33acc1.tar.gz CMake-7d35b550605596b441af65e96be320ab7d33acc1.tar.bz2 |
ExternalProject: Add option to disable download progress (#14807)
Add a DOWNLOAD_NO_PROGRESS option to disable progress reports while
downloading source tarballs.
-rw-r--r-- | Modules/ExternalProject.cmake | 14 | ||||
-rw-r--r-- | Tests/ExternalProject/CMakeLists.txt | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 1e83163..8235dda 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -20,6 +20,7 @@ # [DOWNLOAD_NAME fname] # File name to store (if not end of URL) # [DOWNLOAD_DIR dir] # Directory to store downloaded files # [DOWNLOAD_COMMAND cmd...] # Command to download source tree +# [DOWNLOAD_NO_PROGRESS 1] # Disable download progress reports # [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository # [CVS_MODULE mod] # Module to checkout from CVS repo # [CVS_TAG tag] # Tag to checkout from CVS repo @@ -515,7 +516,7 @@ endif() endfunction(_ep_write_gitupdate_script) -function(_ep_write_downloadfile_script script_filename remote local timeout hash tls_verify tls_cainfo) +function(_ep_write_downloadfile_script script_filename remote local timeout no_progress hash tls_verify tls_cainfo) if(timeout) set(timeout_args TIMEOUT ${timeout}) set(timeout_msg "${timeout} seconds") @@ -524,6 +525,12 @@ function(_ep_write_downloadfile_script script_filename remote local timeout hash set(timeout_msg "none") endif() + if(no_progress) + set(show_progress "") + else() + set(show_progress "SHOW_PROGRESS") + endif() + if("${hash}" MATCHES "${_ep_hash_regex}") set(hash_args EXPECTED_HASH ${CMAKE_MATCH_1}=${CMAKE_MATCH_2}) else() @@ -563,7 +570,7 @@ ${tls_cainfo} file(DOWNLOAD \"${remote}\" \"${local}\" - SHOW_PROGRESS + ${show_progress} ${hash_args} ${timeout_args} STATUS status @@ -1443,10 +1450,11 @@ function(_ep_add_download_command name) string(REPLACE ";" "-" fname "${fname}") set(file ${download_dir}/${fname}) get_property(timeout TARGET ${name} PROPERTY _EP_TIMEOUT) + get_property(no_progress TARGET ${name} PROPERTY _EP_DOWNLOAD_NO_PROGRESS) get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY) get_property(tls_cainfo TARGET ${name} PROPERTY _EP_TLS_CAINFO) set(download_script "${stamp_dir}/download-${name}.cmake") - _ep_write_downloadfile_script("${download_script}" "${url}" "${file}" "${timeout}" "${hash}" "${tls_verify}" "${tls_cainfo}") + _ep_write_downloadfile_script("${download_script}" "${url}" "${file}" "${timeout}" "${no_progress}" "${hash}" "${tls_verify}" "${tls_cainfo}") set(cmd ${CMAKE_COMMAND} -P "${download_script}" COMMAND) set(retries 3) diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index d9344ec..0ed5561 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -98,6 +98,7 @@ ExternalProject_Add(${proj} CVS_TAG "" DEPENDS "MinimalNoOpProject" NonExternalProjectTarget DOWNLOAD_COMMAND "" + DOWNLOAD_NO_PROGRESS 1 INSTALL_COMMAND "" PATCH_COMMAND "" STEP_TARGETS install update |