From 5bbc45d589ba0a5725c232c57de38d8e8ea97598 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 Nov 2003 17:34:01 -0500 Subject: [PATCH] BUG: The cmake_symlink_library command needs to remove existing files before creating links. --- Source/cmake.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5a478d069..8cc6f7a85 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -727,6 +727,10 @@ int cmake::CMakeCommand(std::vector& args) if(soName != realName) { std::string fname = cmSystemTools::GetFilenameName(realName); + if(cmSystemTools::FileExists(soName.c_str())) + { + cmSystemTools::RemoveFile(soName.c_str()); + } if(!cmSystemTools::CreateSymlink(fname.c_str(), soName.c_str())) { result = 1; @@ -735,6 +739,10 @@ int cmake::CMakeCommand(std::vector& args) if(name != soName) { std::string fname = cmSystemTools::GetFilenameName(soName); + if(cmSystemTools::FileExists(soName.c_str())) + { + cmSystemTools::RemoveFile(name.c_str()); + } if(!cmSystemTools::CreateSymlink(fname.c_str(), name.c_str())) { result = 1;