From beff29f0d4bf1ffface0e6833f29f2f04ceccf0b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 16 Oct 2015 19:19:51 +0200 Subject: 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 7e4c917..4d153b7 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); } @@ -4437,6 +4437,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, const std::string &result, diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index f3b8d1f..f5a894b 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 850fc6a..1c4faab 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2119,23 +2119,6 @@ cmTarget::ImportedGetFullPath(const std::string& config, bool pimplib) const } //---------------------------------------------------------------------------- -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 a9d2454..443a2d0 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; }; -- cgit v0.12