source_group(): Support forward slashes in group hierarchy
Most things in CMake use forward slashes for path-like things, even on Windows. The conversion to the appropriate platform specific slash type is handled as needed. Projects therefore can consistently use forward slashes pretty much everywhere in their CMakeLists.txt files. An exception to this is the source_group()
command which requires backslashes for separating levels within the group name. For example this works as expected:
source_group(foo\\bar FILES ...)
But this does not:
source_group(foo/bar FILES ...)
Any forward slashes are treated as part of the name rather than a group level separator. For consistency with the rest of CMake, forward slashes should be supported here so that either slash type works.