[CMake] cmake -E create_symlink for Windows

Richard Bateman richard at batemansr.us
Mon Dec 14 09:50:51 EST 2009


That is correct; Cygwin applications and compilers (anything that uses the cygwin filesystem) would be able to use it, but no windows applications (such as Visual Studio) would be able to do so.

NTFS has long supported hard-links (or Junction points: http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx), but that's not the same thing as a symlink, of course.  I have often used junctions on windows as a replacement for symlinks, but that can be a little confusing to a user that doesn't know how they work.  Symbolic links were (as has been mentioned) introduced in Windows Vista using the mklink command, and they also work in Windows 7.

Personally, I would find it useful to be able to have it create junction points on older versions of windows, but there are several problems; it might not be worth it.  The first problem is that it wouldn't work on FAT32; another big problem is that most windows users don't know how to remove a junction, and many tools don't know how to deal with them.  That being the case, if you delete a junction to a directory, a program not understanding that it is a junction could delete all the files in the directory that it points to.  There are some explorer extensions and other tools to help with that, but I would consider it dangerous to enable that by default.

Just my $.02 =]

--
Richard

14.12.2009, в 6:42, Andreas Pakulat написал(а):

> On 14.12.09 14:29:06, Marcel Loose wrote:
>> On Mon, 2009-12-14 at 08:23 -0500, Bill Lorensen wrote:
>>> http://en.wikipedia.org/wiki/Symbolic_link#Cygwin_symbolic_links
>>> 
>> 
>> OK, that puts us back at square one.
>> 
>> Why is it that CMake cannot use Windows shortcuts as an alternative to
>> Unix symbolic links, whereas Cygwin can?
> 
> Becaue Cygwin emulates a complete filesystem IIRC (at least inside its
> bash). The problem is not that cmake could not create a shortcut for the -E
> create_symlink  call, the problem is that very few apps are able to
> recognize the shortcut as symlink and act accordingly. So it simply doesn't
> make any sense to create one if it only works when the user double-clicks
> on it in explorer.
> 
> Andreas
> 
> -- 
> Keep it short for pithy sake.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake







More information about the CMake mailing list