summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2015-09-22 00:08:26 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2015-09-22 00:08:26 (GMT)
commitb58de9fe2ba4ac3e194403ecd118fd54681ffae8 (patch)
tree789846ed936c0a2e0cf09abb755d487042263720 /Source/cmSystemTools.cxx
parent47b060aee0871bdb5fea63b398a1f1cb07fa3b37 (diff)
downloadCMake-b58de9fe2ba4ac3e194403ecd118fd54681ffae8.zip
CMake-b58de9fe2ba4ac3e194403ecd118fd54681ffae8.tar.gz
CMake-b58de9fe2ba4ac3e194403ecd118fd54681ffae8.tar.bz2
CPack: allow packaging of empty directories
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 2675066..c24b5ea 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -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);
}