From 5e68642d164f1634f3df452df8930b0ef163d3a1 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 11 May 2006 09:37:48 -0400 Subject: ENH: use @ file for winzip on windows --- Source/CPack/cmCPackZIPGenerator.cxx | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx index d8ad47f..578fa0a 100644 --- a/Source/CPack/cmCPackZIPGenerator.cxx +++ b/Source/CPack/cmCPackZIPGenerator.cxx @@ -90,13 +90,16 @@ int cmCPackZIPGenerator::InitializeInternal() int cmCPackZIPGenerator::CompressFiles(const char* outFileName, const char* toplevel, const std::vector& 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 - << "\""; + << "\" -P \"" << outFileName + << "\" @\"" << tempFileName.c_str() << "\""; break; case cmCPackZIPGenerator::StyleUnixZip: dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM") @@ -108,12 +111,26 @@ int cmCPackZIPGenerator::CompressFiles(const char* outFileName, << std::endl); return 0; } - std::vector::const_iterator fileIt; - for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) + if(tempFileName.size()) { - dmgCmd << " \"" - << cmSystemTools::RelativePath(toplevel, fileIt->c_str()) - << "\""; + cmGeneratedFileStream out(tempFileName.c_str()); + std::vector::const_iterator fileIt; + for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) + { + out << "\"" + << cmSystemTools::RelativePath(toplevel, fileIt->c_str()) + << "\"" << std::endl; + } + } + else + { + std::vector::const_iterator fileIt; + for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) + { + dmgCmd << " \"" + << cmSystemTools::RelativePath(toplevel, fileIt->c_str()) + << "\""; + } } std::string output; int retVal = -1; -- cgit v0.12