From 1a3ad5c615be02cd18fe8e166b16ee15f821df72 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Fri, 13 Aug 2010 17:51:27 +0200 Subject: [PATCH] Add XZ compress support to libarchive-wrapper This is not needed but it does not cost much to do it for all potentially supported format in libarchive. XZ and LZMA are not builtin libarchive and require external lib but if CMAKE_USE_SYSTEM_LIBARCHIVE is ON then we may get it for free. --- Source/cmArchiveWrite.cxx | 8 ++++++++ Source/cmArchiveWrite.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index bea9586125..524e53ed64 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -87,6 +87,14 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): return; } break; + case CompressXZ: + if(archive_write_set_compression_xz(this->Archive) != ARCHIVE_OK) + { + this->Error = "archive_write_set_compression_xz: "; + this->Error += archive_error_string(this->Archive); + return; + } + break; }; #if !defined(_WIN32) || defined(__CYGWIN__) if (archive_read_disk_set_standard_lookup(this->Disk) != ARCHIVE_OK) diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 0bd3e9b005..ce7f961c61 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -33,7 +33,8 @@ public: CompressNone, CompressGZip, CompressBZip2, - CompressLZMA + CompressLZMA, + CompressXZ }; /** Archive Type */