Merge topic 'ExternalProject-add-lzma'

56e6975c ExternalProject: Recognize lzma-compressed files (#13515)
98ea0344 ExternalProject: Recognize .tbz2 extension
This commit is contained in:
Brad King 2014-07-30 09:31:47 -04:00 committed by CMake Topic Stage
commit 6370c90f95
2 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1,5 @@
ExternalProject-add-lzma
------------------------
* The :module:`ExternalProject` module learned to support lzma-compressed
source tarballs with ``.7z``, ``.tar.xz``, and ``.txz`` extensions.

View File

@ -737,7 +737,7 @@ endfunction()
function(_ep_write_extractfile_script script_filename name filename directory)
set(args "")
if(filename MATCHES "(\\.|=)(bz2|tar\\.gz|tgz|zip)$")
if(filename MATCHES "(\\.|=)(7z|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$")
set(args xfz)
endif()
@ -746,7 +746,7 @@ function(_ep_write_extractfile_script script_filename name filename directory)
endif()
if(args STREQUAL "")
message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .bz2, .tar, .tar.gz, .tgz and .zip")
message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .7z, .tar, .tar.bz2, .tar.gz, .tar.xz, .tbz2, .tgz, .txz and .zip")
return()
endif()
@ -1540,11 +1540,11 @@ function(_ep_add_download_command name)
if("x${fname}" STREQUAL "x")
string(REGEX MATCH "[^/\\?]*$" fname "${url}")
endif()
if(NOT "${fname}" MATCHES "(\\.|=)(bz2|tar|tgz|tar\\.gz|zip)$")
string(REGEX MATCH "([^/\\?]+(\\.|=)(bz2|tar|tgz|tar\\.gz|zip))/.*$" match_result "${url}")
if(NOT "${fname}" MATCHES "(\\.|=)(7z|tar|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$")
string(REGEX MATCH "([^/\\?]+(\\.|=)(7z|tar|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip))/.*$" match_result "${url}")
set(fname "${CMAKE_MATCH_1}")
endif()
if(NOT "${fname}" MATCHES "(\\.|=)(bz2|tar|tgz|tar\\.gz|zip)$")
if(NOT "${fname}" MATCHES "(\\.|=)(7z|tar|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$")
message(FATAL_ERROR "Could not extract tarball filename from url:\n ${url}")
endif()
string(REPLACE ";" "-" fname "${fname}")