Without quotes list expansion happens inside the set-call, if the list is empty,
this actually unsets the variable. This is not intended and could lead to
unwanted side effects. List expansion is not required there, quoting the
variable results in setting the variable to empty for empty lists.
Since the file lists contain only valid paths, it is sufficient to anchor
the regular expression at the end only instead of matching the full path.
This prevents regular expression injections.
Using the path prefix as part of a regular expression can lead to a
regular expression injection, the path might contain regular expression
meta characters that get interpreted. Use cmake_path() instead to filter
path prefixes.
This function uses default groups like Visual Studio and additional groups
for files commonly used by CMake builds.
This increases the required CMake version to 3.20.