summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-08-17 20:06:52 (GMT)
committerBrad King <brad.king@kitware.com>2005-08-17 20:06:52 (GMT)
commit78112eef25772968412c32026b6a98f3817afe8d (patch)
treecd1dc51afe5ef27ab2989359241ea9804c885c26 /Source/cmake.cxx
parent122ef73e3a9375925fe9be0c8f7a8328b11b2bac (diff)
downloadCMake-78112eef25772968412c32026b6a98f3817afe8d.zip
CMake-78112eef25772968412c32026b6a98f3817afe8d.tar.gz
CMake-78112eef25772968412c32026b6a98f3817afe8d.tar.bz2
ENH: Added -E cmake_symlink_executable command to help create symbolic links for versioned executables.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 9ea46c5..2929437 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -885,6 +885,26 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
}
return result;
}
+ // Internal CMake versioned executable support.
+ else if (args[1] == "cmake_symlink_executable" && args.size() == 4)
+ {
+ int result = 0;
+ std::string realName = args[2];
+ std::string name = args[3];
+ if(name != realName)
+ {
+ std::string fname = cmSystemTools::GetFilenameName(realName);
+ if(cmSystemTools::FileExists(realName.c_str()))
+ {
+ cmSystemTools::RemoveFile(name.c_str());
+ }
+ if(!cmSystemTools::CreateSymlink(fname.c_str(), name.c_str()))
+ {
+ result = 1;
+ }
+ }
+ return result;
+ }
// Internal CMake dependency scanning support.
else if (args[1] == "cmake_depends" && args.size() >= 6)