cmGeneratorFileSet: Support different mappings

The full path of a file in a file set can be broken into groups like
`<base>/[<sub>/]<name>`, where `<base>` is the base directory and
`<name>` is the file name without any directory components. Existing
users evaluate file set files as a mapping from `<rel>` to the full
path. However, CPS export needs files grouped by base directory, and
cares about the composition of `<rel>` and `<name>`. To facilitate
obtaining this information in a more useful form, refactor how we
extract file set files to allow the user to pass a lambda 'handler' for
each file, which has the base directory, full path, and path relative to
the base directory available. (We already obtained `<rel>` from the
latter, so while this technically means the existing use needs to do
additional work, in practice it just means the call to get `<rel>` moves
to the lambda.)

Because there are many existing users that would need to duplicate the
lambda, the old methods are retained as-is, although this does result in
minor code duplication between `GetFiles` (which calls the overload of
`EvaluateFileEntry` which fills the old file map) and `EvaluateFiles`
(which is essentially `GetFiles`, but accepts a user-provided 'handler'
lambda rather than directly producing a file map).
2 files changed