Unnecessary restriction of COMPRESSION_LEVEL for file(ARCHIVE_CREATE)
The file(ARCHIVE_CREATE) command introduced a COMPRESSION_LEVEL
option in CMake 3.19. This option has a restriction that it can only be set, if the COMPRESSION
option is present too.
The COMPRESSION
option may not be set for the zip
and 7zip
formats:
CMake Error at CMakeLists.txt:4 (file):
file archive format zip does not support COMPRESSION arguments
This restriction I understand, since those formats already imply a specific compression algorithm to be used, but they could support setting a compression level as well. At least libarchive
seems to support a compression-level
option for zip
and 7zip
as well. So I think the COMPRESSION_LEVEL
option should not depend on the COMPRESSION
option.
Related to #21125 (closed) and !5242 (merged).