mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-09 17:18:18 +00:00
Exclude files and directories matching the given patterns while creating an archive, using libarchive's matcher for parity with file(ARCHIVE_EXTRACT). Fixes: #27877.
9 lines
265 B
CMake
9 lines
265 B
CMake
set(COMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/compress_dir)
|
|
file(WRITE ${COMPRESS_DIR}/f1.txt "f1")
|
|
|
|
file(ARCHIVE_CREATE
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/out.tar
|
|
FORMAT gnutar
|
|
PATHS ${COMPRESS_DIR}
|
|
PATTERNS_EXCLUDE "*.o" "") # empty pattern is rejected
|