[cmake-commits] alex committed cmCPackZIPGenerator.cxx 1.6 1.7 cmCPackZIPGenerator.h 1.3 1.4

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jun 14 12:03:55 EDT 2007


Update of /cvsroot/CMake/CMake/Source/CPack
In directory public:/mounts/ram/cvs-serv29167

Modified Files:
	cmCPackZIPGenerator.cxx cmCPackZIPGenerator.h 
Log Message:
ENH: support 7zip for creating zip files (not 7z files)

Alex


Index: cmCPackZIPGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackZIPGenerator.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cmCPackZIPGenerator.cxx	23 Sep 2006 18:41:08 -0000	1.6
+++ cmCPackZIPGenerator.cxx	14 Jun 2007 16:03:53 -0000	1.7
@@ -56,6 +56,25 @@
     this->ZipStyle = cmCPackZIPGenerator::StyleWinZip;
     found = true;
     }
+
+  if ( !found )
+    {
+    pkgPath = "c:/Program Files/7-Zip";
+    path.push_back(pkgPath);
+    pkgPath = cmSystemTools::FindProgram("7z", path, false);
+
+    if ( pkgPath.empty() )
+      {
+      cmCPackLogger(cmCPackLog::LOG_DEBUG, "Cannot find 7ZIP"
+        << std::endl);
+      }
+    else
+      {
+      this->ZipStyle = cmCPackZIPGenerator::Style7Zip;
+      found = true;
+      }
+    }
+
   if ( !found )
     {
     path.erase(path.begin(), path.end());
@@ -103,6 +122,13 @@
            << "\" @winZip.filelist";
     needQuotesInFile = true;
     break;
+  case cmCPackZIPGenerator::Style7Zip:
+    // this is the zip generator, so tell 7zip to generate zip files
+    dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
+           << "\" a -tzip \"" << outFileName
+           << "\" @winZip.filelist";
+    needQuotesInFile = true;
+    break;
   case cmCPackZIPGenerator::StyleUnixZip:
     dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
       << "\" -r \"" << outFileName

Index: cmCPackZIPGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackZIPGenerator.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cmCPackZIPGenerator.h	2 Feb 2007 19:40:26 -0000	1.3
+++ cmCPackZIPGenerator.h	14 Jun 2007 16:03:53 -0000	1.4
@@ -41,7 +41,8 @@
     {
     StyleUnkown,
     StyleWinZip,
-    StyleUnixZip
+    StyleUnixZip,
+    Style7Zip
     };
 
 protected:



More information about the Cmake-commits mailing list