summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-06-14 16:03:53 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-06-14 16:03:53 (GMT)
commitf80d98bc09982540f874925da3c324537f2ac201 (patch)
tree66c81cc96b24d5cd9ebcd6e46d939041554edb13
parent756f455565082cfc725e7c07283211d058f8ebea (diff)
downloadCMake-f80d98bc09982540f874925da3c324537f2ac201.zip
CMake-f80d98bc09982540f874925da3c324537f2ac201.tar.gz
CMake-f80d98bc09982540f874925da3c324537f2ac201.tar.bz2
ENH: support 7zip for creating zip files (not 7z files)
Alex
-rw-r--r--Source/CPack/cmCPackZIPGenerator.cxx26
-rw-r--r--Source/CPack/cmCPackZIPGenerator.h3
2 files changed, 28 insertions, 1 deletions
diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx
index 962cc75..f14622f 100644
--- a/Source/CPack/cmCPackZIPGenerator.cxx
+++ b/Source/CPack/cmCPackZIPGenerator.cxx
@@ -56,6 +56,25 @@ int cmCPackZIPGenerator::InitializeInternal()
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 @@ int cmCPackZIPGenerator::CompressFiles(const char* outFileName,
<< "\" @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
diff --git a/Source/CPack/cmCPackZIPGenerator.h b/Source/CPack/cmCPackZIPGenerator.h
index 8700360..06d9b99 100644
--- a/Source/CPack/cmCPackZIPGenerator.h
+++ b/Source/CPack/cmCPackZIPGenerator.h
@@ -41,7 +41,8 @@ public:
{
StyleUnkown,
StyleWinZip,
- StyleUnixZip
+ StyleUnixZip,
+ Style7Zip
};
protected: