ENH: Add command to copy directory with content
This commit is contained in:
parent
39fcca05cf
commit
dd851619ac
|
@ -658,6 +658,7 @@ void CMakeCommandUsage(const char* program)
|
||||||
<< " chdir dir cmd [args]... - run command in a given directory\n"
|
<< " chdir dir cmd [args]... - run command in a given directory\n"
|
||||||
<< " copy file destination - copy file to destination (either file or 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_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"
|
<< " echo [string]... - displays arguments as text\n"
|
||||||
<< " remove file1 file2 ... - remove the file(s)\n"
|
<< " remove file1 file2 ... - remove the file(s)\n"
|
||||||
<< " time command [args] ... - run command and return elapsed time\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;
|
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
|
// Echo string
|
||||||
else if (args[1] == "echo" )
|
else if (args[1] == "echo" )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue