file(INSTALL): Do not pre-create DESTINATION for DIRECTORY

When installing a DIRECTORY, do not pre-create the DESTINATION.  The
cmFileCopier::InstallDirectory method will create the directory anyway.
Give it a chance to detect whether the directory already exists or not.
This commit is contained in:
Brad King 2014-06-23 13:52:17 -04:00
parent f0a0196250
commit f701b0b7f7
1 changed files with 13 additions and 10 deletions

View File

@ -2057,6 +2057,8 @@ bool cmFileInstaller::HandleInstallDestination()
this->DestDirLength = int(sdestdir.size());
}
if(this->InstallType != cmInstallType_DIRECTORY)
{
if ( !cmSystemTools::FileExists(destination.c_str()) )
{
if ( !cmSystemTools::MakeDirectory(destination.c_str()) )
@ -2074,6 +2076,7 @@ bool cmFileInstaller::HandleInstallDestination()
this->FileCommand->SetError(errstring);
return false;
}
}
return true;
}