ENH: use @ file for winzip on windows

This commit is contained in:
Bill Hoffman 2006-05-11 09:37:48 -04:00
parent 9c28eb8f49
commit 5e68642d16
1 changed files with 24 additions and 7 deletions

View File

@ -90,13 +90,16 @@ int cmCPackZIPGenerator::InitializeInternal()
int cmCPackZIPGenerator::CompressFiles(const char* outFileName,
const char* toplevel, const std::vector<std::string>& files)
{
std::string tempFileName;
cmOStringStream dmgCmd;
switch ( this->ZipStyle )
{
case cmCPackZIPGenerator::StyleWinZip:
tempFileName = toplevel;
tempFileName += "/winZip.filelist";
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
<< "\" -P \"" << outFileName
<< "\"";
<< "\" @\"" << tempFileName.c_str() << "\"";
break;
case cmCPackZIPGenerator::StyleUnixZip:
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
@ -108,6 +111,19 @@ int cmCPackZIPGenerator::CompressFiles(const char* outFileName,
<< std::endl);
return 0;
}
if(tempFileName.size())
{
cmGeneratedFileStream out(tempFileName.c_str());
std::vector<std::string>::const_iterator fileIt;
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
{
out << "\""
<< cmSystemTools::RelativePath(toplevel, fileIt->c_str())
<< "\"" << std::endl;
}
}
else
{
std::vector<std::string>::const_iterator fileIt;
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
{
@ -115,6 +131,7 @@ int cmCPackZIPGenerator::CompressFiles(const char* outFileName,
<< cmSystemTools::RelativePath(toplevel, fileIt->c_str())
<< "\"";
}
}
std::string output;
int retVal = -1;
int res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,