summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-08-19 13:38:17 (GMT)
committerBrad King <brad.king@kitware.com>2005-08-19 13:38:17 (GMT)
commit904305e3cba9c03d98160a1667ec7500e6841e6b (patch)
tree9c3716a844d7907f8cde0bdcd754afcf7264d90b /Source/cmake.cxx
parent7a3240160e56ff13cef66063c25c65db27ab36f4 (diff)
downloadCMake-904305e3cba9c03d98160a1667ec7500e6841e6b.zip
CMake-904305e3cba9c03d98160a1667ec7500e6841e6b.tar.gz
CMake-904305e3cba9c03d98160a1667ec7500e6841e6b.tar.bz2
ENH: Added cmake -E create_symlink command that behaves like ln -s.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2929437..fa4cb0c 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -714,6 +714,9 @@ void CMakeCommandUsage(const char* program)
<< " write_regv key value - write registry value\n"
<< " delete_regv key - delete registry value\n"
<< " comspec - on windows 9x use this for RunCommand\n";
+#else
+ errorStream
+ << " create_symlink old new - create a symbolic link new -> old\n";
#endif
cmSystemTools::Error(errorStream.str().c_str());
@@ -852,6 +855,14 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
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.
else if (args[1] == "cmake_symlink_library" && args.size() == 5)
{