summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-29 14:08:06 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-09-29 14:08:06 (GMT)
commit6a072563d2c81f653986318882f9782469a58936 (patch)
tree66b89387d38af1af25bcd5f346c5152f58395f16 /Source
parentddd082fb1fc4a771e84162bd9ef2553ef44bad7c (diff)
parent9298f56dcedb888ff140b6b1aab90be91162d50f (diff)
downloadCMake-6a072563d2c81f653986318882f9782469a58936.zip
CMake-6a072563d2c81f653986318882f9782469a58936.tar.gz
CMake-6a072563d2c81f653986318882f9782469a58936.tar.bz2
Merge topic 'cpack-package-empty-dirs'
9298f56d CPack: allow packaging of empty directories ecd71c9c SystemTools: time operations on directories 19c6f4ee SystemTools: set time file permissions 749a140a CPackDeb: allow empty directories in component packages
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackGenerator.cxx10
-rw-r--r--Source/cmSystemTools.cxx11
4 files changed, 20 insertions, 7 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/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 5cdab52..93c94e2 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -95,6 +95,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel,
std::string findExpr(this->GetOption("GEN_WDIR"));
findExpr += "/*";
gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
if ( !gl.FindFiles(findExpr) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -222,6 +223,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne()
std::string findExpr(this->GetOption("GEN_WDIR"));
findExpr += "/*";
gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
if ( !gl.FindFiles(findExpr) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
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) )
{
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 2675066..d3c1f16 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2045,10 +2045,11 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile)
cmSystemToolsWindowsHandle hFrom =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fromFile).c_str(),
GENERIC_READ, FILE_SHARE_READ, 0,
- OPEN_EXISTING, 0, 0);
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
cmSystemToolsWindowsHandle hTo =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(toFile).c_str(),
- GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
+ FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!hFrom || !hTo)
{
return false;
@@ -2100,7 +2101,8 @@ bool cmSystemTools::FileTimeGet(const char* fname, cmSystemToolsFileTime* t)
#if defined(_WIN32) && !defined(__CYGWIN__)
cmSystemToolsWindowsHandle h =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(),
- GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+ GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!h)
{
return false;
@@ -2127,7 +2129,8 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t)
#if defined(_WIN32) && !defined(__CYGWIN__)
cmSystemToolsWindowsHandle h =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(),
- GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
+ FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!h)
{
return false;