add_custom_target fails when generating target in root drive on Windows
There appears to be an extremely obscure bug where if you call add_custom_target
from a CMakeLists.txt at the root of a Windows drive path, then the command will not actually be added to the generated target. This appears to happen because of a mismatch between the path which maps the target to the rule file and the normalized path.
I solved this issue by editing cmLocalGenerator.cxx
, adding force = sf->GetFullPath();
after line 4306. If there is interest I could put this in a merge request.
I will attach a minimum reproduction example as soon as I have one.