[cmake-commits] martink committed cmake.cxx 1.289 1.290

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Mar 12 15:10:02 EST 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv24303

Modified Files:
	cmake.cxx 
Log Message:
ENH: added remove_directory bug 2937


Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.289
retrieving revision 1.290
diff -u -d -r1.289 -r1.290
--- cmake.cxx	12 Mar 2007 17:30:35 -0000	1.289
+++ cmake.cxx	12 Mar 2007 20:10:00 -0000	1.290
@@ -801,6 +801,7 @@
     " 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 @@
       }
 #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 @@
       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)
       {



More information about the Cmake-commits mailing list