ENH: Added cmake -E create_symlink command that behaves like ln -s.

This commit is contained in:
Brad King 2005-08-19 09:38:17 -04:00
parent 7a3240160e
commit 904305e3cb
1 changed files with 11 additions and 0 deletions

View File

@ -714,6 +714,9 @@ void CMakeCommandUsage(const char* program)
<< " write_regv key value - write registry value\n" << " write_regv key value - write registry value\n"
<< " delete_regv key - delete registry value\n" << " delete_regv key - delete registry value\n"
<< " comspec - on windows 9x use this for RunCommand\n"; << " comspec - on windows 9x use this for RunCommand\n";
#else
errorStream
<< " create_symlink old new - create a symbolic link new -> old\n";
#endif #endif
cmSystemTools::Error(errorStream.str().c_str()); cmSystemTools::Error(errorStream.str().c_str());
@ -852,6 +855,14 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
return 1; return 1;
} }
// Command to create a symbolic link. Fails on platforms not
// supporting them.
else if (args[1] == "create_symlink" && args.size() == 4)
{
return cmSystemTools::CreateSymlink(args[2].c_str(),
args[3].c_str())? 0:1;
}
// Internal CMake shared library support. // Internal CMake shared library support.
else if (args[1] == "cmake_symlink_library" && args.size() == 5) else if (args[1] == "cmake_symlink_library" && args.size() == 5)
{ {