CLI11 icon indicating copy to clipboard operation
CLI11 copied to clipboard

CPACK_SOURCE_IGNORE_FILES should be regex- not globs

Open david-fong opened this issue 3 years ago • 0 comments

Disclaimer: I am just trying to interpret the CMake docs and I may have made mistakes. I am still learning about CPack.

CPACK_SOURCE_IGNORE_FILES uses regex- not globs

Pattern of files in the source tree that won't be packaged when building a source package. This is a list of regular expression patterns (that must be properly escaped)

Additionally, see these notes about CPACK_VERBATIM_VARIABLES:

If set to TRUE, values of variables prefixed with CPACK_ will be escaped before being written to the configuration files, so that the cpack program receives them exactly as they were specified. If not, characters like quotes and backslashes can cause parsing errors or alter the value received by the cpack program. Defaults to FALSE for backwards compatibility.

Some of the current entries in this repo are written as if they were globs. /\\\\.DS_Store seems to be the right idea: the four backslashes become two in the generated configuration file, which becomes one literal backslash. It could possibly be improved as "/\\\\.DS_Store$" (trailing $).

If you wanted to avoid the whole escaping fiasco altogether, I believe you could use bracket arguments (available starting CMake 3.0) combined with CPACK_VERBATIM_VARIABLES (available starting CMake 3.4, which is the minimum supported by this project).

If I'm not accidentally spewing nonsense here, this probably isn't that important given that nobody seems to have noticed it. I don't think source packaging is a very widely used feature of CMake.

david-fong avatar Aug 10 '22 04:08 david-fong