From 9a58ac6649a9e12e06306a7d23aaaf767dea0e64 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 Nov 2003 14:52:12 -0500 Subject: ENH: Added CreateSymlink method. --- Source/cmSystemTools.cxx | 10 ++++++++++ Source/cmSystemTools.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1d12ac9..50a43ef 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1060,3 +1060,13 @@ bool cmSystemTools::StringEndsWith(const char* str1, const char* str2) } return !strncmp(str1 + (strlen(str1)-strlen(str2)), str2, strlen(str2)); } + +bool cmSystemTools::CreateSymlink(const char* origName, const char* newName) +{ +#if !defined(_WIN32) || defined(__CYGWIN__) + return (symlink(origName, newName) >= 0); +#else + // Should we create a copy here? + return false; +#endif +} diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 2ba1906..4406b0e 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -243,7 +243,8 @@ public: //! Check if the first string ends with the second one. static bool StringEndsWith(const char* str1, const char* str2); - + + static bool CreateSymlink(const char* origName, const char* newName); private: static bool s_ForceUnixPaths; static bool s_RunCommandHideConsole; -- cgit v0.12