[CMake] No FileIsSymlink(...) for Win32?

Miguel A. Figueroa-Villanueva miguelf at ieee.org
Thu Nov 15 11:29:57 EST 2007


On 11/14/07, Gonzalo Garramuño wrote:
> Miguel A. Figueroa-Villanueva wrote:
> You may, however, want to request a function to parse shortcuts, albeit
> you can probably write it in .cmake yourself (as it a .lnk file is just
> a text file).

Yes, I understand that windows doesn't have real symbolic links...

However, I searched the web for win32 functions that would interpret
the shortcut/symlink and couldn't find anything except how cygwin is
doing it.

So, what I'm trying to asses is whether an implementation of the cmake:

SystemTools::FileIsSymlink(),

which now just returns false for windows, is feasible or not. More to
the point, am I missing something or *if I implement it, will it be
applied to cmake source code*?

That way the SystemTools::MakeDirectory() function could do something like

if(SystemTools::FileIsSymlink(topdir.c_str()))
  {
    if (target is directory)
      {
      // if so, readjust the string of the path to be created (topdir)
      // and continue to trascend...
      }
    else
      {
      Mkdir(topdir.c_str());
      }
  }
else
 {
 Mkdir(topdir.c_str());
 }

Other methods could probably use it to support directory shortcuts
where appropriate.

These are some good references I found about the format of the shortcut file:
- http://stdlib.com/art6-Shortcut-File-Format-lnk.html
- http://mediasrv.ns.ac.yu/extra/fileformat/windows/lnk/shortcut.pdf

--Miguel


More information about the CMake mailing list