[CMake] CPack picks up AppleDouble files when running in OS X

Segev BenZvi sybenzvi at gmail.com
Thu Sep 24 10:29:30 EDT 2015


Hi all,

I've run into an annoying issue making package sources with CPack in OS X
(Mavericks and Yosemite).

I set up CPack to produce a tarball of my source tree with bzip, but in OS
X tar will pick up the AppleDouble files in the source folder and stuff
them into the archive too. As a result my tarball is full of duplicate
source files (i.e., source.cc and its double ._source.cc), which causes
problems when building the source later.

This is **not** the fault of CPack; it is a known issue with tar in OS X.
The way to suppress the AppleDouble files when running tar on the command
line is to set the environment variable COPYFILE_DISABLE=1, e.g.,

$> COPYFILE_DISABLE=1 tar cjf package.tbz2 /path/to/src

This works just fine for me. Unfortunately, even if I have COPYFILE_DISABLE
set in my environment, CPack doesn't seem to pick it up when calling tar.
As a result the AppleDouble files keep showing up in my archive when I call
"make package_source." While it's not a blocker for me -- I can produce the
source package on a Linux box -- I do most of my development on my MacBook
so this is pretty annoying.

I tried some other tricks, like including the line

SET (CPACK_SOURCE_IGNORE_FILES "[.]_.*;")

in my top-level CMakeLists.txt, but that doesn't help.

I looked through the cmake email archives but couldn't find anyone else who
has raised this issue... so either I've missed the right emails or there is
an obvious fix I'm overlooking. Any ideas what I'm doing wrong?

Thanks for your attention!

Best regards,
Segev BenZvi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150924/2593e524/attachment.html>


More information about the CMake mailing list