summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2015-09-28 20:50:15 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2015-09-28 23:18:18 (GMT)
commit9298f56dcedb888ff140b6b1aab90be91162d50f (patch)
treebb61e7768f1ef64290eddfe9becf001c5968aae9 /Source/CPack
parentecd71c9c1a0735cb84234344387f4138a1853fa5 (diff)
downloadCMake-9298f56dcedb888ff140b6b1aab90be91162d50f.zip
CMake-9298f56dcedb888ff140b6b1aab90be91162d50f.tar.gz
CMake-9298f56dcedb888ff140b6b1aab90be91162d50f.tar.bz2
CPack: allow packaging of empty directories
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackGenerator.cxx10
2 files changed, 11 insertions, 3 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 58bd947..70de757 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -78,7 +78,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
std::string rp = filePrefix + *fileIt;
cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: "
<< rp << std::endl);
- archive.Add(rp);
+ archive.Add(rp, 0, 0, false);
if (!archive)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
@@ -284,7 +284,7 @@ int cmCPackArchiveGenerator::PackageFiles()
// Get the relative path to the file
std::string rp = cmSystemTools::RelativePath(toplevel.c_str(),
fileIt->c_str());
- archive.Add(rp);
+ archive.Add(rp, 0, 0, false);
if(!archive)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< "
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 92a4b2b..def9fc7 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -367,6 +367,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install directory: " << top << std::endl);
gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
if ( !gl.FindFiles(findExpr) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -379,7 +380,11 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
for ( gfit = files.begin(); gfit != files.end(); ++ gfit )
{
bool skip = false;
- std::string &inFile = *gfit;
+ std::string inFile = *gfit;
+ if(cmSystemTools::FileIsDirectory(*gfit))
+ {
+ inFile += '/';
+ }
for ( regIt= ignoreFilesRegex.begin();
regIt!= ignoreFilesRegex.end();
++ regIt)
@@ -869,6 +874,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmsys::Glob glB;
findExpr += "/*";
glB.RecurseOn();
+ glB.SetRecurseListDirs(true);
glB.FindFiles(findExpr);
filesBefore = glB.GetFiles();
std::sort(filesBefore.begin(),filesBefore.end());
@@ -908,6 +914,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
{
cmsys::Glob glA;
glA.RecurseOn();
+ glA.SetRecurseListDirs(true);
glA.FindFiles(findExpr);
std::vector<std::string> filesAfter = glA.GetFiles();
std::sort(filesAfter.begin(),filesAfter.end());
@@ -1074,6 +1081,7 @@ int cmCPackGenerator::DoPackage()
std::string findExpr = tempDirectory;
findExpr += "/*";
gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
gl.SetRecurseThroughSymlinks(false);
if ( !gl.FindFiles(findExpr) )
{