[CMake] file timestamp with symbolic link under Windows

Manu ianmalcom at gmail.com
Wed Aug 9 11:09:18 EDT 2017


Hello CMakers,

I recently switched from CMake 2.8.12 to 3.8.2 and the behaviour of

file(TIMESTAMP MyFile MyFileTimestamp)

changed when MyFileis a symbolic link under Windows.

In 2.8.12 the funtion was reporting of the actual file timestamp pointed by
the symbolic link.
In 3.8.2 the funcitons returns the symbolic link itself timpestamp.

Has this behaviour changed intentionally? I do not find anything related in
the change logs.

Trying to workaround this issue, I stumbled upon get_filename_component
function which I can use to get the realpath of a symbolic link but when I
use it as:

get_filename_component(MyFileRealPath ${MyFile} REALPATH)

MyFileRealPath contains the symbolic link path, not the real path!. I am
currently digging in cmake source code and considering reporting as a bug.

Any comments will be warmly welcomed.

Regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170809/773c5370/attachment.html>


More information about the CMake mailing list