mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03: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
|