diff options
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 32c6638..4f7c391 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2008,6 +2008,40 @@ std::string cmTarget::GetSOName(const char* config) } //---------------------------------------------------------------------------- +std::string cmTarget::NormalGetRealName(const char* config) +{ + // This should not be called for imported targets. + // TODO: Split cmTarget into a class hierarchy to get compile-time + // enforcement of the limited imported target API. + if(this->IsImported()) + { + abort(); + } + + if(this->GetType() == cmTarget::EXECUTABLE) + { + // Compute the real name that will be built. + std::string name; + std::string realName; + std::string impName; + std::string pdbName; + this->GetExecutableNames(name, realName, impName, pdbName, config); + return realName; + } + else + { + // Compute the real name that will be built. + std::string name; + std::string soName; + std::string realName; + std::string impName; + std::string pdbName; + this->GetLibraryNames(name, soName, realName, impName, pdbName, config); + return realName; + } +} + +//---------------------------------------------------------------------------- std::string cmTarget::GetFullName(const char* config, bool implib) { if(this->IsImported()) @@ -2037,7 +2071,8 @@ void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base, } //---------------------------------------------------------------------------- -std::string cmTarget::GetFullPath(const char* config, bool implib) +std::string cmTarget::GetFullPath(const char* config, bool implib, + bool realname) { if(this->IsImported()) { @@ -2045,19 +2080,27 @@ std::string cmTarget::GetFullPath(const char* config, bool implib) } else { - return this->NormalGetFullPath(config, implib); + return this->NormalGetFullPath(config, implib, realname); } } //---------------------------------------------------------------------------- -std::string cmTarget::NormalGetFullPath(const char* config, bool implib) +std::string cmTarget::NormalGetFullPath(const char* config, bool implib, + bool realname) { // Start with the output directory for the target. std::string fpath = this->GetDirectory(config, implib); fpath += "/"; // Add the full name of the target. - fpath += this->GetFullName(config, implib); + if(realname) + { + fpath += this->NormalGetRealName(config); + } + else + { + fpath += this->GetFullName(config, implib); + } return fpath; } |