cmGeneratorTarget: Move ComputeVersionedName from cmTarget.

This commit is contained in:
Stephen Kelly 2015-10-16 19:19:51 +02:00
parent 12e4790a0b
commit beff29f0d4
4 changed files with 26 additions and 26 deletions

View File

@ -3250,11 +3250,11 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
else
{
// The library's soname.
this->Target->ComputeVersionedName(soName, prefix, base, suffix,
this->ComputeVersionedName(soName, prefix, base, suffix,
name, soversion);
// The library's real name on disk.
this->Target->ComputeVersionedName(realName, prefix, base, suffix,
this->ComputeVersionedName(realName, prefix, base, suffix,
name, version);
}
@ -4436,6 +4436,23 @@ void cmGeneratorTarget::GetTargetVersion(bool soversion,
}
}
//----------------------------------------------------------------------------
void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
std::string const& prefix,
std::string const& base,
std::string const& suffix,
std::string const& name,
const char* version) const
{
vName = this->Makefile->IsOn("APPLE") ? (prefix+base) : name;
if(version)
{
vName += ".";
vName += version;
}
vName += this->Makefile->IsOn("APPLE") ? suffix : std::string();
}
//----------------------------------------------------------------------------
void
cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,

View File

@ -483,6 +483,13 @@ private:
// Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
const char* GetOutputTargetType(bool implib) const;
void ComputeVersionedName(std::string& vName,
std::string const& prefix,
std::string const& base,
std::string const& suffix,
std::string const& name,
const char* version) const;
struct CompatibleInterfacesBase
{
std::set<std::string> PropsBool;

View File

@ -2118,23 +2118,6 @@ cmTarget::ImportedGetFullPath(const std::string& config, bool pimplib) const
return result;
}
//----------------------------------------------------------------------------
void cmTarget::ComputeVersionedName(std::string& vName,
std::string const& prefix,
std::string const& base,
std::string const& suffix,
std::string const& name,
const char* version) const
{
vName = this->IsApple? (prefix+base) : name;
if(version)
{
vName += ".";
vName += version;
}
vName += this->IsApple? suffix : std::string();
}
//----------------------------------------------------------------------------
void cmTarget::SetPropertyDefault(const std::string& property,
const char* default_value)

View File

@ -414,13 +414,6 @@ private:
friend class cmGeneratorTarget;
friend class cmTargetTraceDependencies;
void ComputeVersionedName(std::string& vName,
std::string const& prefix,
std::string const& base,
std::string const& suffix,
std::string const& name,
const char* version) const;
cmListFileBacktrace Backtrace;
};