ENH: Add proper support for installing bundles

This commit is contained in:
Andy Cedilnik
2006-03-28 13:16:15 -05:00
parent 0d540b31e0
commit ed5f95cf23
4 changed files with 25 additions and 20 deletions

View File

@@ -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 ";