summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-04 17:19:41 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-05 16:20:43 (GMT)
commit41abdc17df99662a8e99ba895050dbc8c0e34b8e (patch)
treeca27f70ba5884758eb78d64df23d9202c69c7a1f /Source/cmGeneratorTarget.cxx
parent1aa13f2b58e477095f76d28a8d9bb1b83a9dd1f5 (diff)
downloadCMake-41abdc17df99662a8e99ba895050dbc8c0e34b8e.zip
CMake-41abdc17df99662a8e99ba895050dbc8c0e34b8e.tar.gz
CMake-41abdc17df99662a8e99ba895050dbc8c0e34b8e.tar.bz2
cmGeneratorTarget: Move GetSOName from cmTarget..
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index bd57b3d..e17df9e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -650,6 +650,49 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
}
//----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetSOName(const std::string& config) const
+{
+ if(this->Target->IsImported())
+ {
+ // Lookup the imported soname.
+ if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
+ {
+ if(info->NoSOName)
+ {
+ // The imported library has no builtin soname so the name
+ // searched at runtime will be just the filename.
+ return cmSystemTools::GetFilenameName(info->Location);
+ }
+ else
+ {
+ // Use the soname given if any.
+ if(info->SOName.find("@rpath/") == 0)
+ {
+ return info->SOName.substr(6);
+ }
+ return info->SOName;
+ }
+ }
+ else
+ {
+ return "";
+ }
+ }
+ else
+ {
+ // Compute the soname that will be built.
+ std::string name;
+ std::string soName;
+ std::string realName;
+ std::string impName;
+ std::string pdbName;
+ this->Target->GetLibraryNames(name, soName, realName,
+ impName, pdbName, config);
+ return soName;
+ }
+}
+
+//----------------------------------------------------------------------------
std::string
cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const
{