BUG: The cmake_symlink_library command needs to remove existing files before creating links.

This commit is contained in:
Brad King 2003-11-26 17:34:01 -05:00
parent f764e1fcb2
commit 5bbc45d589

View File

@ -727,6 +727,10 @@ int cmake::CMakeCommand(std::vector<std::string>& 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<std::string>& 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;