Hi,
CMake 3.19 added a COMPRESSION_LEVEL
option to the file(ARCHIVE_CREATE) command. Would it be possible to add a flag for setting the compression level to the built-in tar command (cmake -E tar ...
) as well? I suppose the implementation is already there, you would just need to extend the command line interface? This would be great so that one could use the compression level feature in custom commands/targets as well, e.g. to zip some output files in a post-build step. I would suggest to have the flag (or flags) be named -0
, -1
, …, -9
to conform to command line tools like zip, gzip, xz, etc.
Also, is there a reason, why the COMPRESSION_LEVEL
option can only be set when COMPRESSION
is set too? I get that the zip
and 7zip
formats already imply a specific compression algorithm so it makes no sense to set the COMPRESSION
option with either of them, but as far as I know those formats support different compression levels as well. At least libarchive that CMake uses seems to support a compression-level
option for zip
and 7zip
as well.
Thanks