[CMake] CPack: Ignoring files using regex

Glenn Coombs glenn.coombs at gmail.com
Wed Jul 31 15:50:48 EDT 2013


The regexp you're using matches anything where the last character at the
end of the line isn't one of the characters inside the square brackets.  I
don't think cmake's regexps allow negation of words so specifying a regexp
that matches everything except projectA/, README and CMakelists.txt is
going to be tricky.

You could just list the known items that you do want to ignore.  Something
like this:

set(CPACK_SOURCE_IGNORE_FILES "/build/;/extrafiles/;/temp/")

will hopefully ignore directories called build, extrafiles and temp.  It
isn't exactly what you want but might help.

On 29 July 2013 19:40, Chris Wood <c.c.wood at gmail.com> wrote:

> I'm trying to get my head round CMake's regex implementation; I have a
> folder containing 4 folder and 2 text files:
>
> build/
> projectA/
> CMakeLists.txt
> extrafiles/
> README
> temp/
>
> one line of CMakeLists.txt is:
>
> set(CPACK_SOURCE_IGNORE_FILES "[^projectA]$")
>
> in my source package that is ten subsequently generated, `build/`
> `projectA/` and `extrafiles` are present, but `temp/` and the 2 text
> files are not. I'm trying to get to a stage where the regex will
> ignore everything in the folder except for `projectA/`, `README` and
> `CMakeLists.txt`, but can't work out at the moment how the regex I've
> supplied is giving those results.
>
> Any insight will be greatly appreciated!
>
> Chris
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130731/02615021/attachment.htm>


More information about the CMake mailing list