diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2015-01-08 21:56:33 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2015-01-09 15:35:01 (GMT) |
commit | df16dcfb4478bb05932a1abb0e42433e60f1a565 (patch) | |
tree | a9118455e89a8785d189f150b32409c980212cd6 /Source/cmcmd.cxx | |
parent | b0a5d3932d2a6633d05eca3eb7fd632f433dca05 (diff) | |
download | CMake-df16dcfb4478bb05932a1abb0e42433e60f1a565.zip CMake-df16dcfb4478bb05932a1abb0e42433e60f1a565.tar.gz CMake-df16dcfb4478bb05932a1abb0e42433e60f1a565.tar.bz2 |
cmake -E tar: add support for .xz files with 'J'
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f2f028a..6b3efb5 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -71,7 +71,7 @@ void CMakeCommandUsage(const char* program) << " remove_directory dir - remove a directory and its contents\n" << " rename oldname newname - rename a file or directory " "(on one volume)\n" - << " tar [cxt][vf][zj] file.tar [file/dir1 file/dir2 ...]\n" + << " tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n" << " - create or extract a tar or zip archive\n" << " sleep <number>... - sleep for given number of seconds\n" << " time command [args] ... - run command and return elapsed time\n" @@ -735,11 +735,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) } bool gzip = false; bool bzip2 = false; + bool xz = false; bool verbose = false; if ( flags.find_first_of('j') != flags.npos ) { bzip2 = true; } + if ( flags.find_first_of('J') != flags.npos ) + { + xz = true; + } if ( flags.find_first_of('z') != flags.npos ) { gzip = true; @@ -760,7 +765,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) else if ( flags.find_first_of('c') != flags.npos ) { if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, gzip, bzip2, verbose) ) + outFile.c_str(), files, gzip, bzip2, xz, verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; |