[CMake] cmake -E create_symlink for Windows

Marcel Loose loose at astron.nl
Sun Dec 13 17:38:18 EST 2009


On Sat, 2009-12-12 at 14:35 -0800, Alan W. Irwin wrote:
> On 2009-12-12 12:02-0500 Bill Hoffman wrote:
> 
> > Some things just can not be done cross platform.   For example reading/ 
> > writing the windows registry, creating an OSX application bundle, and 
> > sym-links.  Also, some computers don't even have shared libraries. Should we 
> > disable those features from CMake?  That said, the symlink command is the 
> > only -E that does not work cross platform.   The -E create_symlink does 
> > return failure from main when called on windows. So, if you used it in a 
> > custom command which is the idea for -E stuff, it would fail in a noticeable 
> > way (the build would fail).  If you call it from execute_process, you should 
> > be checking the return value as well.
> 
> I guess I am the victim of the assumption that all cmake -E commands are
> supposed to work cross-platform since all of them do so (which I was glad to
> hear) other than create_symlink.  Right now, here is what cmake -E help says
> about that command.
> 
>    create_symlink old new    - create a symbolic link new -> old
> 
> If you simply added (UNIX ONLY) to that documentation string, then users
> like me wouldn't make unwarranted assumptions.
> 
> Alan
> __________________________
> Alan W. Irwin
> 
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
> 
> Programming affiliations with the FreeEOS equation-of-state implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
> package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
> 
> Linux-powered Science
> __________________________

I second that. I was also under the impression that 'cmake -E' provided
a nice abstraction for a number of commands that could be used
cross-platform, but with different syntaxes. Seems that create_symlink
is the odd one out here. Bummer!

The thing is: it's too late when the build fails (on Windows), because
long before then, I, as a developer of the build environment, decided to
use the presumed cross-platform command create_symlink, only to find out
much later that it doesn't work on Windows.

Best regards,
Marcel Loose.




More information about the CMake mailing list