Help with CPack ignore regex

All,

I’m hoping for some help here. We recently found that we need to add some extra files to our CPACK_SOURCE_IGNORE_FILES and, well, I need help. I currently have:

set(CPACK_SOURCE_IGNORE_FILES
  /.git/
  /.mepo/
  /build.*/
  /install.*/
)

but I’d like to add more now. For example, I’d like to ignore any *.swp files in any directory or that vim would make or maybe *~ files from emacs.

So went to a subdirectory and did:

cp CMakeLists.txt CMakeLists.txt.swp

to create a dummy file and tried adding:

  *.swp

but I got:

RegularExpression::compile(): ?+* follows nothing.
RegularExpression::compile(): Error in compile.

So, I look around the web and see that I maybe should use:

   \\\\.swp

and that does compile…but doesn’t seem to do what I want as the test CMakeLists.txt.swp file I made is still in the tarfile made by CPack.

So what is the right way to figure out these regexes?

Thanks,
Matt

Wouldn’t it make more sense to give CPack the ability to honor .git-ignore files?

Or use git to pack the source?

Also using CPack to package sources is quite inefficient as it copies to another directory first instead of directly into the archive.

This looks like glob, not a regex. Maybe you wan’t .*\.swp, instead.