file(ARCHIVE_CREATE): no custom root directory from which to archive from, seems to default to PROJECT_BINARY_DIR
Hello kitware,
When archiving files to an archive (e.g. zip), it's not possible to prepare the directory structure in advance in a sub-tree. We're forced to pollute PROJECT_BINARY_DIR with possible collisions with what needs to be compressed. See here.
Could you add a flag to indicate the root directory part(s) of what will be compressed, part(s) that should be removed in the recorded relative path (being smart with dangling directory separators)?
Suggestion of naming:
EXCLUDE_ROOT_PATHS prefix1 [prefix2...]
Example:
file(
CREATE_ARCHIVE package.zip
PATHS
to_archive/libstuff.so
sub/tree/part/to/exclude/keep/me/properties.txt
readme.txt
/some/absolute/path/env_version.txt
EXCLUDE_ROOT_PATHS
to_archive
sub/tree/part/to/exclude
/some/absolute/path
)
would result in:
- libstuff.so
- keep/me/properties.txt
- readme.txt
- env_version.txt
Thanks in advance. Regards.