diff options
author | Brad King <brad.king@kitware.com> | 2008-02-06 18:34:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-06 18:34:44 (GMT) |
commit | 07be6bb87b27cc09ee17ae9b6850f00893eb586e (patch) | |
tree | de478766a53a16ab569afee087d6ae4bd58b2b54 /Source/cmTarget.cxx | |
parent | a752fc5e8500be8a1fc8f5891374f23d125762a3 (diff) | |
download | CMake-07be6bb87b27cc09ee17ae9b6850f00893eb586e.zip CMake-07be6bb87b27cc09ee17ae9b6850f00893eb586e.tar.gz CMake-07be6bb87b27cc09ee17ae9b6850f00893eb586e.tar.bz2 |
ENH: When linking to versioned targets whose real file name is known pass the real name to the linker instead of the symlink name.
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; } |