[CMake] cmake -E create_symlink for Windows

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sat Dec 12 11:42:23 EST 2009


On 2009-12-12 09:44-0500 David Cole wrote:

> On Fri, Dec 11, 2009 at 10:04 AM, Michael Wild <themiwi at gmail.com> wrote:
> 
> Bummer. What where they THINKING??? (if at all...). It seems to me
> that M$ just CAN'T get it right. No matter how many times they try,
> how many good examples are out there, they always manage to seriously
> screw something up... Come to think of it, they probably were thinking
> about symlink-attacks...
> 
> 
> Come on. Let's make a deal: you don't bash Microsoft, Apple or Google here
> on the CMake mailing list and I won't bash Unix or Linux in any forum,
> anywhere, ever. OK? Does that sound cool?

Absolutely.  There used to be another poster here (before he got
so-over-the-top that he was removed) that kept making gratuitous attacks on
Linux and free software, and that was extremely annoying.  So as a Linux
developer I support Dave's call to be aware of other's strong feelings
and stay on topic so we don't waste a lot of time here.

Back on topic....

I am one of the lead developers of the PLplot CMake-based build system.
However, my development experience is Linux only so I must rely on my
Windows developer colleagues to catch any Linux-only or Unix-only mistakes I
put into our build system.  Up to this thread, I had no idea that there
wasn't some reliable way to create symlinks on Windows, and it's only by
chance that I haven't used create_symlink in any part of our build other
than the Linux-only documentation build.

Before this thread, I always assumed cmake -E commands gave you an excellent
way to do common tasks in a cross-platform way.  I appeal to the CMake
developers to avoid from now on implementing any more CMake -E commands that
have no hope of ever fulfilling that mandate, Also, please deprecate and
document the cmake -E commands with obvious cross-platform limitations
because otherwise your users are going to assume (like I did) that those
commands are the recommended way to help make their project cross-platform.
Is create_symlink an isolated case, or are there other cmake -E commands to
worry about?

Also, is create_symlink really a lost cross-platform cause?  Reading later
in Dave's post, it appears that the symlink concept does work on some
Windows platform (he mentioned something about "shortcuts").  If there are
intentions to make it work on a number of Windows platforms eventually, but
that just hasn't happened yet, then _warn_ about that issue (e.g., something
like "Unix-only for now" in the documentation).  Also, if the CMake -E
command is run on a platform that doesn't support it something better than a
silent failure should be the result.

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
__________________________


More information about the CMake mailing list