summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2007-03-12 20:10:00 (GMT)
committerKen Martin <ken.martin@kitware.com>2007-03-12 20:10:00 (GMT)
commitf59e649dc20dcf6b67dbef7d55e804b70f913e41 (patch)
treee1224d32f61a381f52180b66f95ec3c2118be23b /Source/cmake.cxx
parente105c7fedc026d4f455a5b8d240db7d638341f2f (diff)
downloadCMake-f59e649dc20dcf6b67dbef7d55e804b70f913e41.zip
CMake-f59e649dc20dcf6b67dbef7d55e804b70f913e41.tar.gz
CMake-f59e649dc20dcf6b67dbef7d55e804b70f913e41.tar.bz2
ENH: added remove_directory bug 2937
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 3bd8637..e2e624d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -801,6 +801,7 @@ void CMakeCommandUsage(const char* program)
" line\n"
<< " environment - display the current enviroment\n"
<< " make_directory dir - create a directory\n"
+ << " remove_directory dir - remove a directory and its contents\n"
<< " remove file1 file2 ... - remove the file(s)\n"
<< " tar [cxt][vfz] file.tar file/dir1 file/dir2 ... - create a tar.\n"
<< " time command [args] ... - run command and return elapsed time\n"
@@ -914,7 +915,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
}
#endif
- if (args[1] == "make_directory" && args.size() == 3)
+ else if (args[1] == "make_directory" && args.size() == 3)
{
if(!cmSystemTools::MakeDirectory(args[2].c_str()))
{
@@ -925,6 +926,17 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
return 0;
}
+ else if (args[1] == "remove_directory" && args.size() == 3)
+ {
+ if(!cmSystemTools::RemoveADirectory(args[2].c_str()))
+ {
+ std::cerr << "Error removing directory \"" << args[2].c_str()
+ << "\".\n";
+ return 1;
+ }
+ return 0;
+ }
+
// Remove file
else if (args[1] == "remove" && args.size() > 2)
{