diff options
author | Brad King <brad.king@kitware.com> | 2010-06-07 18:22:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-06-07 18:22:26 (GMT) |
commit | 79f01660c922db5683a65c4c1efbc767dc817b6b (patch) | |
tree | 3b21e30ec0dcd489beb5f3d4abafa4c323421bad /Modules | |
parent | 33b59ee8ddedefab6156ef1468ec8e31647af9c3 (diff) | |
parent | 2deba1b9119e6a3dd40931606e08b70744735650 (diff) | |
download | CMake-79f01660c922db5683a65c4c1efbc767dc817b6b.zip CMake-79f01660c922db5683a65c4c1efbc767dc817b6b.tar.gz CMake-79f01660c922db5683a65c4c1efbc767dc817b6b.tar.bz2 |
Merge branch 'more-formats-in-ExternalProject'
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ExternalProject.cmake | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index ddb4ece..d96f005 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -249,20 +249,16 @@ endfunction(_ep_write_downloadfile_script) function(_ep_write_extractfile_script script_filename filename directory) set(args "") - if(filename MATCHES ".tar$") - set(args xf) - endif() - - if(filename MATCHES ".tgz$") + if(filename MATCHES "(\\.bz2|\\.tar\\.gz|\\.tgz|\\.zip)$") set(args xfz) endif() - if(filename MATCHES ".tar.gz$") - set(args xfz) + if(filename MATCHES "\\.tar$") + set(args xf) endif() if(args STREQUAL "") - message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .tar, .tgz and .tar.gz") + message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .bz2, .tar, .tar.gz, .tgz and .zip") return() endif() @@ -276,6 +272,10 @@ message(STATUS \"extracting... src='\${filename}' dst='\${directory}'\") +if(NOT EXISTS \"\${filename}\") + message(FATAL_ERROR \"error: file to extract does not exist: '\${filename}'\") +endif() + # Prepare a space for extracting: # set(i 1234) @@ -703,7 +703,7 @@ function(_ep_add_download_command name) if("${url}" MATCHES "^[a-z]+://") # TODO: Should download and extraction be different steps? string(REGEX MATCH "[^/]*$" fname "${url}") - if(NOT "${fname}" MATCHES "\\.(tar|tgz|tar\\.gz)$") + if(NOT "${fname}" MATCHES "\\.(bz2|tar|tgz|tar\\.gz|zip)$") message(FATAL_ERROR "Could not extract tarball filename from url:\n ${url}") endif() set(file ${download_dir}/${fname}) |