file(TOUCH_NOCREATE) errors on broken symlink
When file(TOUCH_NOCREATE)
is given a symlink that has a non-existent target it errors out with:
CMake Error at ... (file):
file problem touching file:
/home/guoj/dev/path/to/symlink
Looking at the docs for this function: "Use TOUCH_NOCREATE to touch a file if it exists but not create it. If a file does not exist it will be silently ignored."
The correct behavior seems to be that it should ignore the broken symlink silently. This would make it consistent with if(EXISTS)
which treats broken symlinks as non-existent.
CMake Version: 3.18.0 (From Kitware Apt Repo) System: Linux Mint 20/Ubuntu 20.04