tar / zip creation is very inflexible
Suppose during my build I gather a load of files in ${CMAKE_BINARY_DIR}/Pack
. I want to zip the contents of that folder. As of today there is actually no good way to do that. The only way to get cmake -E tar cfv ...
to make a zip that doesn't contain a directory called Pack
, but actually contains the contents of that directory is to list the contents explicitly like this:
cd /path/to/Pack
cmake -E tar cfv OutputFile.zip --format=zip -- /path/to/Pack/file1.txt /path/to/Pack/file2.txt /path/to/Pack/file3.txt
The problem is you can't just glob those files, because at configure time they haven't been copied there yet. I tried all sorts of working-directory / relative path combinations but none of them work. Some produce bizarre results like having a directory called ..
in the zip.
My current "solution" is to list all those file manually. That obviously sucks because you have to remember to add them to the list.
Possibly related: #8769