Hi all.
By default, admin privileges are necessary to run mklink (even for
creating symlinks). However, this can be changed by granting the
SeCreateSymbolicLinkPrivilege privilege (see e.g.
http://superuser.com/questions/124679/how-do-i-create-an-mklink-in-windows-7-home-premium-as-a-regular-user)
Petr
On Mon, Aug 20, 2012 at 11:39 PM, David Cole david.c...@kitware.com wrote:
On Mon, Aug 20, 2012 at 5:16 PM, Daniel Pfeifer dan...@pfeifer-mail.de
wrote:
2012/8/20 David Cole david.c...@kitware.com:
Call for CMake developers! Please adopt one or more of these bugs if you
can.
The following 11 bugs are on the CMake 2.8.10 roadmap, but they are
UNASSIGNED. They do not have anybody actively working on them at the
moment.
...
http://public.kitware.com/Bug/view.php?id=13162
Is it ok to use the Windows API to create symlinks? That would enable
symlinks depending for what version of Windows CMake is compiled.
bool SystemTools::CreateSymlink(const char* origName, const char* newName)
{
#if !defined(_WIN32) || defined(__CYGWIN__)
return symlink(origName, newName) = 0;
#elif (_WIN32_WINNT = 0x0600)
DWORD flags =
SystemTools::FileIsDirectory(origName)?SYMBOLIC_LINK_FLAG_DIRECTORY:0
return CreateSymbolicLink(newName, origName, flags) != FALSE;
#else
(void)origName;
(void)newName;
return false;
#endif
}
cheers, Daniel
It's ok with me. I think that's the only reasonable way to do it.
I've heard (but not tried personally, so don't know how much is just rumor)
that the symlink stuff on Windows requires admin privilege level... so it
may be less useful than folks think.
Let's just make sure to return errors when symlinks can't be created.
Hopefully with text suggesting what went wrong.
Thanks,
David
--
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
--
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