create_test_sourcelist: fails to compile test driver when path contains tilde
When storing a project under a path which contains a tilde (~
) in the pathname create_test_sourcelist
fails to compile.
Apple uses (or can use?) a tilde in the pathname of a mounted iCloud Drive. I have a code folder stored on their for backup and for easy access over several machines.
The issue appears to be around line 92 in CMake/Source/cmCreateTestSourceList.cxx
where several illegal characters are replaced by underscore characters but the tilde is not included in the list.
See https://gitlab.kitware.com/cmake/cmake/-/blob/v3.24.0/Source/cmCreateTestSourceList.cxx#L92 for the location of the issue.
Adding std::replace(func_name.begin(), func_name.end(), '~', '_');
at line 93 would allow projects to be stored under paths containing a ~
.
Edited by Brad King