From beff29f0d4bf1ffface0e6833f29f2f04ceccf0b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 16 Oct 2015 19:19:51 +0200 Subject: [PATCH] cmGeneratorTarget: Move ComputeVersionedName from cmTarget. --- Source/cmGeneratorTarget.cxx | 21 +++++++++++++++++++-- Source/cmGeneratorTarget.h | 7 +++++++ Source/cmTarget.cxx | 17 ----------------- Source/cmTarget.h | 7 ------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 7e4c917a14..4d153b7b25 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -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, diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index f3b8d1fdcd..f5a894b6a4 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -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 PropsBool; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 850fc6a534..1c4faab07a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -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) diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a9d2454cef..443a2d0f9b 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -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; };