summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-28 18:16:15 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-28 18:16:15 (GMT)
commited5f95cf230c5ccd4376ff6dcc8e57330611f256 (patch)
tree77a16a0730fba3cf83ade11a8632e6272ada3e42 /Source/cmFileCommand.cxx
parent0d540b31e01b1c478636e35dfc8bb58405e77629 (diff)
downloadCMake-ed5f95cf230c5ccd4376ff6dcc8e57330611f256.zip
CMake-ed5f95cf230c5ccd4376ff6dcc8e57330611f256.tar.gz
CMake-ed5f95cf230c5ccd4376ff6dcc8e57330611f256.tar.bz2
ENH: Add proper support for installing bundles
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index dbb8799..0262bb5 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -571,6 +571,10 @@ bool cmFileCommand::HandleInstallCommand(
{
itype = cmTarget::MODULE_LIBRARY;
}
+ else if ( stype == "DIRECTORY" )
+ {
+ itype = cmTarget::INSTALL_DIRECTORY;
+ }
if ( !cmSystemTools::FileExists(destination.c_str()) )
{
@@ -775,7 +779,23 @@ bool cmFileCommand::HandleInstallCommand(
std::string message;
if(!cmSystemTools::SameFile(fromFile.c_str(), toFile.c_str()))
{
- if(cmSystemTools::FileExists(fromFile.c_str()))
+ if(itype == cmTarget::INSTALL_DIRECTORY &&
+ cmSystemTools::FileIsDirectory(fromFile.c_str()))
+ {
+ // We will install this file. Display the information.
+ message = "Installing ";
+ message += toFile.c_str();
+ this->Makefile->DisplayStatus(message.c_str(), -1);
+ if(!cmSystemTools::CopyADirectory(fromFile.c_str(), toFile.c_str()))
+ {
+ cmOStringStream e;
+ e << "INSTALL cannot copy directory \"" << fromFile
+ << "\" to \"" << toFile + "\".";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ }
+ else if(cmSystemTools::FileExists(fromFile.c_str()))
{
// We will install this file. Display the information.
message = "Installing ";