[Cmake-commits] CMake branch, next, updated. v3.0.0-4602-ge912114

Brad King brad.king at kitware.com
Tue Jul 29 09:28:20 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  e9121142e5481e82ab828d164716897d6e82c785 (commit)
       via  87c0959aff8eb21de5d1334559e5b75b0fafc6da (commit)
      from  853867d644671401af8bf8796e7a2f969f6038de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e9121142e5481e82ab828d164716897d6e82c785
commit e9121142e5481e82ab828d164716897d6e82c785
Merge: 853867d 87c0959
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 29 09:28:19 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 29 09:28:19 2014 -0400

    Merge topic 'cpack-add-lzma' into next
    
    87c0959a CPack: add generators for .7z and .tar.xz (#13072, #14519)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87c0959aff8eb21de5d1334559e5b75b0fafc6da
commit 87c0959aff8eb21de5d1334559e5b75b0fafc6da
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Thu Jul 10 00:21:36 2014 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jul 29 09:28:43 2014 -0400

    CPack: add generators for .7z and .tar.xz (#13072, #14519)

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index c394946..7f36bb2 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -580,9 +580,11 @@ set(CPACK_SRCS
   CPack/cmCPackIFWGenerator.cxx
   CPack/cmCPackSTGZGenerator.cxx
   CPack/cmCPackTGZGenerator.cxx
+  CPack/cmCPackTXZGenerator.cxx
   CPack/cmCPackTarBZip2Generator.cxx
   CPack/cmCPackTarCompressGenerator.cxx
   CPack/cmCPackZIPGenerator.cxx
+  CPack/cmCPack7zGenerator.cxx
   )
 
 if(CYGWIN)
diff --git a/Source/CPack/cmCPack7zGenerator.cxx b/Source/CPack/cmCPack7zGenerator.cxx
new file mode 100644
index 0000000..ce31ad4
--- /dev/null
+++ b/Source/CPack/cmCPack7zGenerator.cxx
@@ -0,0 +1,25 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+
+#include "cmCPack7zGenerator.h"
+
+//----------------------------------------------------------------------
+cmCPack7zGenerator::cmCPack7zGenerator()
+  :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone,
+                           cmArchiveWrite::Type7Zip)
+{
+}
+
+//----------------------------------------------------------------------
+cmCPack7zGenerator::~cmCPack7zGenerator()
+{
+}
diff --git a/Source/CPack/cmCPack7zGenerator.h b/Source/CPack/cmCPack7zGenerator.h
new file mode 100644
index 0000000..f5a323f
--- /dev/null
+++ b/Source/CPack/cmCPack7zGenerator.h
@@ -0,0 +1,36 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2000-2009 Kitware, Inc.
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+
+#ifndef cmCPack7zGenerator_h
+#define cmCPack7zGenerator_h
+
+#include "cmCPackArchiveGenerator.h"
+
+/** \class cmCPack7zGenerator
+ * \brief A generator for 7z files
+ */
+class cmCPack7zGenerator : public cmCPackArchiveGenerator
+{
+public:
+  cmCPackTypeMacro(cmCPack7zGenerator, cmCPackArchiveGenerator);
+
+  /**
+   * Construct generator
+   */
+  cmCPack7zGenerator();
+  virtual ~cmCPack7zGenerator();
+
+protected:
+  virtual const char* GetOutputExtension() { return ".7z"; }
+};
+
+#endif
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index 788e785..da97657 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -14,9 +14,11 @@
 
 #include "cmCPackGenerator.h"
 #include "cmCPackTGZGenerator.h"
+#include "cmCPackTXZGenerator.h"
 #include "cmCPackTarBZip2Generator.h"
 #include "cmCPackTarCompressGenerator.h"
 #include "cmCPackZIPGenerator.h"
+#include "cmCPack7zGenerator.h"
 #include "cmCPackSTGZGenerator.h"
 #include "cmCPackNSISGenerator.h"
 #include "cmCPackIFWGenerator.h"
@@ -57,6 +59,11 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
     this->RegisterGenerator("TGZ", "Tar GZip compression",
       cmCPackTGZGenerator::CreateGenerator);
     }
+  if (cmCPackTXZGenerator::CanGenerate())
+    {
+    this->RegisterGenerator("TXZ", "Tar XZ compression",
+      cmCPackTXZGenerator::CreateGenerator);
+    }
   if (cmCPackSTGZGenerator::CanGenerate())
     {
     this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression",
@@ -92,6 +99,11 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
     this->RegisterGenerator("ZIP", "ZIP file format",
       cmCPackZIPGenerator::CreateGenerator);
     }
+  if (cmCPack7zGenerator::CanGenerate())
+    {
+    this->RegisterGenerator("7Z", "7-Zip file format",
+      cmCPack7zGenerator::CreateGenerator);
+    }
 #ifdef _WIN32
   if (cmCPackWIXGenerator::CanGenerate())
     {
diff --git a/Source/CPack/cmCPackTXZGenerator.cxx b/Source/CPack/cmCPackTXZGenerator.cxx
new file mode 100644
index 0000000..ecfc177
--- /dev/null
+++ b/Source/CPack/cmCPackTXZGenerator.cxx
@@ -0,0 +1,25 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+
+#include "cmCPackTXZGenerator.h"
+
+//----------------------------------------------------------------------
+cmCPackTXZGenerator::cmCPackTXZGenerator()
+  :cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ,
+                           cmArchiveWrite::TypeTAR)
+{
+}
+
+//----------------------------------------------------------------------
+cmCPackTXZGenerator::~cmCPackTXZGenerator()
+{
+}
diff --git a/Source/CPack/cmCPackTXZGenerator.h b/Source/CPack/cmCPackTXZGenerator.h
new file mode 100644
index 0000000..bf8152f
--- /dev/null
+++ b/Source/CPack/cmCPackTXZGenerator.h
@@ -0,0 +1,35 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2000-2009 Kitware, Inc.
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+
+#ifndef cmCPackTXZGenerator_h
+#define cmCPackTXZGenerator_h
+
+#include "cmCPackArchiveGenerator.h"
+
+/** \class cmCPackTXZGenerator
+ * \brief A generator for TXZ files
+ *
+ */
+class cmCPackTXZGenerator : public cmCPackArchiveGenerator
+{
+public:
+  cmCPackTypeMacro(cmCPackTXZGenerator, cmCPackArchiveGenerator);
+  /**
+   * Construct generator
+   */
+  cmCPackTXZGenerator();
+  virtual ~cmCPackTXZGenerator();
+protected:
+  virtual const char* GetOutputExtension() { return ".tar.xz"; }
+};
+
+#endif
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 3b0ead5..a2aecac 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -159,7 +159,15 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t):
         this->Error += cm_archive_error_string(this->Archive);
         return;
         }
-    break;
+      break;
+    case Type7Zip:
+      if(archive_write_set_format_7zip(this->Archive) != ARCHIVE_OK)
+        {
+        this->Error = "archive_write_set_format_7zip: ";
+        this->Error += cm_archive_error_string(this->Archive);
+        return;
+        }
+      break;
     }
 
   // do not pad the last block!!
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index 3e3b2f0..a6dcc0e 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -42,7 +42,8 @@ public:
   enum Type
   {
     TypeTAR,
-    TypeZIP
+    TypeZIP,
+    Type7Zip
   };
 
   /** Construct with output stream to which to write archive.  */

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeLists.txt                                |    2 ++
 ...mCPackZIPGenerator.cxx => cmCPack7zGenerator.cxx} |    9 ++++-----
 .../{cmCPackZIPGenerator.h => cmCPack7zGenerator.h}  |   18 +++++++++---------
 Source/CPack/cmCPackGeneratorFactory.cxx             |   12 ++++++++++++
 ...CPackTGZGenerator.cxx => cmCPackTXZGenerator.cxx} |    9 ++++-----
 .../{cmCPackTGZGenerator.h => cmCPackTXZGenerator.h} |   18 +++++++++---------
 Source/cmArchiveWrite.cxx                            |   10 +++++++++-
 Source/cmArchiveWrite.h                              |    3 ++-
 8 files changed, 51 insertions(+), 30 deletions(-)
 copy Source/CPack/{cmCPackZIPGenerator.cxx => cmCPack7zGenerator.cxx} (81%)
 copy Source/CPack/{cmCPackZIPGenerator.h => cmCPack7zGenerator.h} (63%)
 copy Source/CPack/{cmCPackTGZGenerator.cxx => cmCPackTXZGenerator.cxx} (81%)
 copy Source/CPack/{cmCPackTGZGenerator.h => cmCPackTXZGenerator.h} (63%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list