BUG: Make cmake -E remove_directory work when directory is not present.

This commit is contained in:
Brad King 2008-01-24 14:37:48 -05:00
parent 3a462fa673
commit 02b1767e42
1 changed files with 2 additions and 1 deletions

View File

@ -1027,7 +1027,8 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
else if (args[1] == "remove_directory" && args.size() == 3)
{
if(!cmSystemTools::RemoveADirectory(args[2].c_str()))
if(cmSystemTools::FileIsDirectory(args[2].c_str()) &&
!cmSystemTools::RemoveADirectory(args[2].c_str()))
{
std::cerr << "Error removing directory \"" << args[2].c_str()
<< "\".\n";