summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-10-06 16:30:43 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-27 19:59:02 (GMT)
commitec38e4c84faa276e664f950b417a71c3901485f6 (patch)
tree7d7a85fcee40d9f950344f07ea4af5480a05e213 /Source/cmGeneratorTarget.cxx
parentdfb025bf126080f6bb209f6f40ff909c4f5c5c97 (diff)
downloadCMake-ec38e4c84faa276e664f950b417a71c3901485f6.zip
CMake-ec38e4c84faa276e664f950b417a71c3901485f6.tar.gz
CMake-ec38e4c84faa276e664f950b417a71c3901485f6.tar.bz2
Move GetFullPath to cmGeneratorTarget
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx82
1 files changed, 81 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index efb414e..edd89e8 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -529,7 +529,7 @@ const char* cmGeneratorTarget::GetLocation(const std::string& config) const
}
else
{
- location = this->Target->GetFullPath(config, false);
+ location = this->GetFullPath(config, false);
}
return location.c_str();
}
@@ -1182,6 +1182,86 @@ void cmGeneratorTarget::GenerateTargetManifest(
}
}
+//----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetFullPath(const std::string& config,
+ bool implib, bool realname) const
+{
+ if(this->Target->IsImported())
+ {
+ return this->Target->ImportedGetFullPath(config, implib);
+ }
+ else
+ {
+ return this->NormalGetFullPath(config, implib, realname);
+ }
+}
+
+std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
+ bool implib,
+ bool realname) const
+{
+ std::string fpath = this->Target->GetDirectory(config, implib);
+ fpath += "/";
+ if(this->Target->IsAppBundleOnApple())
+ {
+ fpath = this->Target->BuildMacContentDirectory(fpath, config, false);
+ fpath += "/";
+ }
+
+ // Add the full name of the target.
+ if(implib)
+ {
+ fpath += this->Target->GetFullName(config, true);
+ }
+ else if(realname)
+ {
+ fpath += this->NormalGetRealName(config);
+ }
+ else
+ {
+ fpath += this->Target->GetFullName(config, false);
+ }
+ return fpath;
+}
+
+//----------------------------------------------------------------------------
+std::string
+cmGeneratorTarget::NormalGetRealName(const std::string& config) const
+{
+ // 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->Target->IsImported())
+ {
+ std::string msg = "NormalGetRealName called on imported target: ";
+ msg += this->GetName();
+ this->Makefile->IssueMessage(cmake::INTERNAL_ERROR, msg);
+ }
+
+ 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->Target->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->Target->GetLibraryNames(name, soName, realName,
+ impName, pdbName, config);
+ return realName;
+ }
+}
+
bool cmStrictTargetComparison::operator()(cmTarget const* t1,
cmTarget const* t2) const
{