CMake support for the file links: add `file(LINK ...)` command
Thinking about adding new command:
file(LINK <file> <newfile> [NOCOPY] [SYMBOLIC])
which will create link (by default hard link) to file. If link can't be created (unsupported/create failed?) then simply copy file unless NOCOPY
is specified. On Unix use
int link(const char* oldpath, const char* newpath)
by default and
int symlink(const char* target, const char* linkpath)
if SYMBOLIC
specified. If file <newfile>
already exists then it will be removed before processing. For me at this moment it's not clear what opportunities we have on Windows. Any hints about it are welcome.