ENH: Add command to create tar

This commit is contained in:
Andy Cedilnik 2005-12-28 16:31:12 -05:00
parent fdc844ecdb
commit 5222266e7e
1 changed files with 19 additions and 0 deletions

View File

@ -720,6 +720,8 @@ void CMakeCommandUsage(const char* program)
<< " 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"
<< " tar file.tar file/dir1 file/dir2 ... - create a tar\n"
<< " untar file.tar - create a tar\n"
<< " time command [args] ... - run command and return elapsed time\n";
#if defined(_WIN32) && !defined(__CYGWIN__)
errorStream
@ -944,6 +946,23 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
return 1;
}
// Tar files
else if (args[1] == "tar" && args.size() > 3)
{
std::string outFile = args[2];
std::vector<cmStdString> files;
for (std::string::size_type cc = 3; cc < args.size(); cc ++)
{
files.push_back(args[cc]);
}
if ( !cmSystemTools::CreateTar(outFile.c_str(), files) )
{
cmSystemTools::Error("Problem creating tar: ", outFile.c_str());
return 1;
}
return 0;
}
#if defined(CMAKE_BUILD_WITH_CMAKE)
// Internal CMake Fortran module support.
else if (args[1] == "cmake_copy_f90_mod" && args.size() >= 4)