mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 02:39:48 -06:00
ExternalProject: Remove explicit list of supported archive types
- Do not try to guess the flags to pass to "cmake -E tar" ("z" or not) based
on the extension. It is not necessary, as the archive type is autodetected
since we switched to libarchive.
- Add new tests for .tar.zst archives, which would fail without the change.
Fixes: #25062
This commit is contained in:
6
Help/release/dev/externalproject-archive-types.rst
Normal file
6
Help/release/dev/externalproject-archive-types.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
externalproject-archive-types
|
||||
-----------------------------
|
||||
|
||||
* The :module:`ExternalProject` module no longer checks the ``URL`` archive
|
||||
file extension. Any archive type that :option:`cmake -E tar <cmake-E tar>`
|
||||
can extract is now allowed.
|
||||
@@ -301,6 +301,10 @@ URL
|
||||
.. versionadded:: 3.1
|
||||
Added support for `tbz2`, `.tar.xz`, `.txz`, and `.7z` extensions.
|
||||
|
||||
.. versionadded:: 4.1
|
||||
All archive types that :option:`cmake -E tar <cmake-E tar>` can extract
|
||||
are supported regardless of file extension.
|
||||
|
||||
Git
|
||||
~~~
|
||||
|
||||
|
||||
@@ -701,23 +701,8 @@ function(_ep_write_extractfile_script
|
||||
directory
|
||||
options
|
||||
)
|
||||
set(args "")
|
||||
|
||||
if(filename MATCHES
|
||||
"(\\.|=)(7z|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$")
|
||||
set(args xfz)
|
||||
endif()
|
||||
|
||||
if(filename MATCHES "(\\.|=)tar$")
|
||||
set(args xf)
|
||||
endif()
|
||||
|
||||
if(args STREQUAL "")
|
||||
message(FATAL_ERROR
|
||||
"Do not know how to extract '${filename}' -- known types are: "
|
||||
".7z, .tar, .tar.bz2, .tar.gz, .tar.xz, .tbz2, .tgz, .txz and .zip"
|
||||
)
|
||||
endif()
|
||||
# cmake -E tar auto detects the type of archive being extracted
|
||||
set(args "xf")
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/extractfile.cmake.in"
|
||||
|
||||
@@ -142,7 +142,7 @@ set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ")
|
||||
# this more complete, we should add a diff between this and the TGZ tree since
|
||||
# that one does build.
|
||||
#
|
||||
set(extra_cmp_exts tar.bz2 tar.xz zip)
|
||||
set(extra_cmp_exts tar.bz2 tar.xz tar.zst zip)
|
||||
foreach(ext IN LISTS extra_cmp_exts)
|
||||
string(TOUPPER "${ext}" name)
|
||||
|
||||
|
||||
BIN
Tests/ExternalProjectLocal/Step1.tar.zst
Normal file
BIN
Tests/ExternalProjectLocal/Step1.tar.zst
Normal file
Binary file not shown.
BIN
Tests/ExternalProjectLocal/Step1NoDir.tar.zst
Normal file
BIN
Tests/ExternalProjectLocal/Step1NoDir.tar.zst
Normal file
Binary file not shown.
Reference in New Issue
Block a user