<div class="gmail_quote">On Mon, Aug 20, 2012 at 5:16 PM, Daniel Pfeifer <span dir="ltr">&lt;<a href="mailto:daniel@pfeifer-mail.de" target="_blank">daniel@pfeifer-mail.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2012/8/20 David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;:<br>
<div class="im HOEnZb">&gt; Call for CMake developers! Please adopt one or more of these bugs if you<br>
&gt; can.<br>
&gt;<br>
&gt; The following 11 bugs are on the CMake 2.8.10 roadmap, but they are<br>
&gt; UNASSIGNED. They do not have anybody actively working on them at the moment.<br>
&gt;<br>
</div><div class="HOEnZb"><div class="h5">&gt;   ...<br>
&gt;   <a href="http://public.kitware.com/Bug/view.php?id=13162" target="_blank">http://public.kitware.com/Bug/view.php?id=13162</a><br>
<br>
Is it ok to use the Windows API to create symlinks? That would enable<br>
symlinks depending for what version of Windows CMake is compiled.<br>
<br>
====<br>
bool SystemTools::CreateSymlink(const char* origName, const char* newName)<br>
{<br>
#if !defined(_WIN32) || defined(__CYGWIN__)<br>
  return symlink(origName, newName) &gt;= 0;<br>
#elif (_WIN32_WINNT &gt;= 0x0600)<br>
  DWORD flags =<br>
    SystemTools::FileIsDirectory(origName)?SYMBOLIC_LINK_FLAG_DIRECTORY:0<br>
  return CreateSymbolicLink(newName, origName, flags) != FALSE;<br>
#else<br>
  (void)origName;<br>
  (void)newName;<br>
  return false;<br>
#endif<br>
}<br>
====<br>
<br>
cheers, Daniel<br>
</div></div></blockquote></div><br><div><br></div><div>It&#39;s ok with me. I think that&#39;s the only reasonable way to do it.</div><div><br></div><div>I&#39;ve heard (but not tried personally, so don&#39;t know how much is just rumor) that the symlink stuff on Windows requires &quot;admin&quot; privilege level... so it may be less useful than folks think.</div>
<div><br></div><div>Let&#39;s just make sure to return errors when symlinks can&#39;t be created. Hopefully with text suggesting what went wrong.</div><div><br></div><div><br></div><div>Thanks,</div><div>David</div><div><br>
</div>