summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-02-11 21:25:30 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-02-11 21:25:30 (GMT)
commitdd851619ac912e03eb71adbf9262cdbd87d6a283 (patch)
treedac0e8d2aca9e704d896b444d6afbf5ae7ed7bc5 /Source/cmake.cxx
parent39fcca05cf2c61e0f70c47997670a107ce7c2ab8 (diff)
downloadCMake-dd851619ac912e03eb71adbf9262cdbd87d6a283.zip
CMake-dd851619ac912e03eb71adbf9262cdbd87d6a283.tar.gz
CMake-dd851619ac912e03eb71adbf9262cdbd87d6a283.tar.bz2
ENH: Add command to copy directory with content
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 6838d39..3a8e26e 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<std::string>& 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" )
{