summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-29 19:04:29 (GMT)
committerBrad King <brad.king@kitware.com>2006-08-29 19:04:29 (GMT)
commit27a67fb72f22bcff5007b45d96ed810405818833 (patch)
tree5aab2eccb41f5483c7211933023640268825d1fe /Source/cmFileCommand.cxx
parent7001a88a746073a46200dde7c6613789cf4b9cc8 (diff)
downloadCMake-27a67fb72f22bcff5007b45d96ed810405818833.zip
CMake-27a67fb72f22bcff5007b45d96ed810405818833.tar.gz
CMake-27a67fb72f22bcff5007b45d96ed810405818833.tar.bz2
ENH: Add support to INSTALL(DIRECTORY) to install an empty directory. This addresses bug#3572.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 1b4ad55..d5d1eb2 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -519,6 +519,11 @@ bool cmFileInstaller::InstallDirectory(const char* source,
return true;
}
+ // Inform the user about this directory installation.
+ std::string message = "Installing ";
+ message += destination;
+ this->Makefile->DisplayStatus(message.c_str(), -1);
+
// Make sure the destination directory exists.
if(!cmSystemTools::MakeDirectory(destination))
{
@@ -568,7 +573,10 @@ bool cmFileInstaller::InstallDirectory(const char* source,
// Load the directory contents to traverse it recursively.
cmsys::Directory dir;
- dir.Load(source);
+ if(source && *source)
+ {
+ dir.Load(source);
+ }
unsigned long numFiles = static_cast<unsigned long>(dir.GetNumberOfFiles());
for(unsigned long fileNum = 0; fileNum < numFiles; ++fileNum)
{
@@ -1280,7 +1288,8 @@ bool cmFileCommand::HandleInstallCommand(
if(!cmSystemTools::SameFile(fromFile.c_str(), toFile.c_str()))
{
if(itype == cmTarget::INSTALL_DIRECTORY &&
- cmSystemTools::FileIsDirectory(fromFile.c_str()))
+ (fromFile.empty() ||
+ cmSystemTools::FileIsDirectory(fromFile.c_str())))
{
// Try installing this directory.
if(!installer.InstallDirectory(fromFile.c_str(), toFile.c_str(),