mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 22:31:18 -05:00
CPack: allow packaging of empty directories
This commit is contained in:
@@ -367,6 +367,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
||||
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
||||
"- Install directory: " << top << std::endl);
|
||||
gl.RecurseOn();
|
||||
gl.SetRecurseListDirs(true);
|
||||
// gl.SetRecurseThroughSymlinks(false);
|
||||
if ( !gl.FindFiles(findExpr) )
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||
@@ -869,6 +871,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 +911,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 +1078,7 @@ int cmCPackGenerator::DoPackage()
|
||||
std::string findExpr = tempDirectory;
|
||||
findExpr += "/*";
|
||||
gl.RecurseOn();
|
||||
gl.SetRecurseListDirs(true);
|
||||
gl.SetRecurseThroughSymlinks(false);
|
||||
if ( !gl.FindFiles(findExpr) )
|
||||
{
|
||||
|
||||
@@ -895,12 +895,33 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname,
|
||||
|
||||
bool cmSystemTools::cmCopyFile(const char* source, const char* destination)
|
||||
{
|
||||
// FIXME remove if statement once kwsys SystemTools get support for
|
||||
// source is directory handling in CopyFileAlways function
|
||||
if(cmSystemTools::FileIsDirectory(source))
|
||||
{
|
||||
return Superclass::MakeDirectory(destination);
|
||||
}
|
||||
|
||||
return Superclass::CopyFileAlways(source, destination);
|
||||
}
|
||||
|
||||
bool cmSystemTools::CopyFileIfDifferent(const char* source,
|
||||
const char* destination)
|
||||
{
|
||||
// FIXME remove if statement once kwsys SystemTools get support for
|
||||
// source is directory handling in CopyFileIfDifferent function
|
||||
if(cmSystemTools::FileIsDirectory(source))
|
||||
{
|
||||
if(SystemTools::FileExists(destination))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Superclass::MakeDirectory(destination);
|
||||
}
|
||||
}
|
||||
|
||||
return Superclass::CopyFileIfDifferent(source, destination);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user