BUG: Need to compute the correct versioned name for executables on cygwin. This addresses bug#5238.
This commit is contained in:
parent
cfe9fda9fe
commit
c0d3ab2d2b
@ -1700,10 +1700,10 @@ bool cmFileCommand::DoInstall( cmFileInstaller& installer,
|
|||||||
std::string libname = toFile;
|
std::string libname = toFile;
|
||||||
std::string soname = toFile;
|
std::string soname = toFile;
|
||||||
std::string soname_nopath = fromName;
|
std::string soname_nopath = fromName;
|
||||||
this->ComputeVersionedName(soname, lib_soversion);
|
this->ComputeVersionedLibName(soname, lib_soversion);
|
||||||
this->ComputeVersionedName(soname_nopath, lib_soversion);
|
this->ComputeVersionedLibName(soname_nopath, lib_soversion);
|
||||||
this->ComputeVersionedName(fromName, lib_version);
|
this->ComputeVersionedLibName(fromName, lib_version);
|
||||||
this->ComputeVersionedName(toFile, lib_version);
|
this->ComputeVersionedLibName(toFile, lib_version);
|
||||||
|
|
||||||
cmSystemTools::RemoveFile(soname.c_str());
|
cmSystemTools::RemoveFile(soname.c_str());
|
||||||
cmSystemTools::RemoveFile(libname.c_str());
|
cmSystemTools::RemoveFile(libname.c_str());
|
||||||
@ -1743,22 +1743,14 @@ bool cmFileCommand::DoInstall( cmFileInstaller& installer,
|
|||||||
if ( exe_version )
|
if ( exe_version )
|
||||||
{
|
{
|
||||||
std::string exename = toFile;
|
std::string exename = toFile;
|
||||||
std::string exename_nopath = fromName;
|
this->ComputeVersionedExeName(fromName, exe_version);
|
||||||
exename_nopath += "-";
|
this->ComputeVersionedExeName(toFile, exe_version);
|
||||||
exename_nopath += exe_version;
|
|
||||||
|
|
||||||
fromName += "-";
|
|
||||||
fromName += exe_version;
|
|
||||||
toFile += "-";
|
|
||||||
toFile += exe_version;
|
|
||||||
|
|
||||||
cmSystemTools::RemoveFile(exename.c_str());
|
cmSystemTools::RemoveFile(exename.c_str());
|
||||||
|
if(!cmSystemTools::CreateSymlink(fromName.c_str(),
|
||||||
if (!cmSystemTools::CreateSymlink(exename_nopath.c_str(),
|
exename.c_str()))
|
||||||
exename.c_str()) )
|
|
||||||
{
|
{
|
||||||
std::string errstring = "error when creating symlink from: "
|
std::string errstring = "error when creating symlink from: "
|
||||||
+ exename + " to " + exename_nopath;
|
+ exename + " to " + fromName;
|
||||||
this->SetError(errstring.c_str());
|
this->SetError(errstring.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1815,8 +1807,8 @@ bool cmFileCommand::DoInstall( cmFileInstaller& installer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmFileCommand::ComputeVersionedName(std::string& name,
|
void cmFileCommand::ComputeVersionedLibName(std::string& name,
|
||||||
const char* version)
|
const char* version)
|
||||||
{
|
{
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
std::string ext;
|
std::string ext;
|
||||||
@ -1834,6 +1826,21 @@ void cmFileCommand::ComputeVersionedName(std::string& name,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void cmFileCommand::ComputeVersionedExeName(std::string& name,
|
||||||
|
const char* version)
|
||||||
|
{
|
||||||
|
std::string ext;
|
||||||
|
if(name.size() > 4 && name.substr(name.size()-4) == ".exe")
|
||||||
|
{
|
||||||
|
ext = ".exe";
|
||||||
|
name = name.substr(0, name.size()-4);
|
||||||
|
}
|
||||||
|
name += "-";
|
||||||
|
name += version;
|
||||||
|
name += ext;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmFileCommand::HandleRelativePathCommand(
|
bool cmFileCommand::HandleRelativePathCommand(
|
||||||
std::vector<std::string> const& args)
|
std::vector<std::string> const& args)
|
||||||
|
@ -159,7 +159,8 @@ protected:
|
|||||||
bool HandleRelativePathCommand(std::vector<std::string> const& args);
|
bool HandleRelativePathCommand(std::vector<std::string> const& args);
|
||||||
bool HandleCMakePathCommand(std::vector<std::string> const& args,
|
bool HandleCMakePathCommand(std::vector<std::string> const& args,
|
||||||
bool nativePath);
|
bool nativePath);
|
||||||
void ComputeVersionedName(std::string& name, const char* version);
|
void ComputeVersionedLibName(std::string& name, const char* version);
|
||||||
|
void ComputeVersionedExeName(std::string& name, const char* version);
|
||||||
|
|
||||||
// FILE(INSTALL ...) related functions
|
// FILE(INSTALL ...) related functions
|
||||||
bool HandleInstallCommand(std::vector<std::string> const& args);
|
bool HandleInstallCommand(std::vector<std::string> const& args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user