diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-12-28 21:31:12 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-12-28 21:31:12 (GMT) |
commit | 5222266e7e8c4b6707ce639f7629fb8c85170698 (patch) | |
tree | 1231b8791adbbb70f2384cf9bd93c20c384729c2 /Source/cmake.cxx | |
parent | fdc844ecdb4d3f67e83ebcb7303ba67a115ac9eb (diff) | |
download | CMake-5222266e7e8c4b6707ce639f7629fb8c85170698.zip CMake-5222266e7e8c4b6707ce639f7629fb8c85170698.tar.gz CMake-5222266e7e8c4b6707ce639f7629fb8c85170698.tar.bz2 |
ENH: Add command to create tar
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 920291b..5176e10 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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) |