From dd851619ac912e03eb71adbf9262cdbd87d6a283 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Fri, 11 Feb 2005 16:25:30 -0500 Subject: [PATCH] ENH: Add command to copy directory with content --- Source/cmake.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 6838d3934..3a8e26ef4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -658,6 +658,7 @@ void CMakeCommandUsage(const char* program) << " chdir dir cmd [args]... - run command in a given directory\n" << " copy file destination - copy file to destination (either file or directory)\n" << " copy_if_different in-file out-file - copy file if input has changed\n" + << " copy_directory source destination - copy directory 'source' content to directory 'destination'\n" << " echo [string]... - displays arguments as text\n" << " remove file1 file2 ... - remove the file(s)\n" << " time command [args] ... - run command and return elapsed time\n"; @@ -700,6 +701,19 @@ int cmake::CMakeCommand(std::vector& args) return 0; } + // Copy directory content + if (args[1] == "copy_directory" && args.size() == 4) + { + if(!cmSystemTools::CopyADirectory(args[2].c_str(), args[3].c_str())) + { + std::cerr << "Error copying directory from \"" + << args[2].c_str() << "\" to \"" << args[3].c_str() + << "\".\n"; + return 1; + } + return 0; + } + // Echo string else if (args[1] == "echo" ) {