summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-10 15:57:02 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-27 19:58:50 (GMT)
commitdfb025bf126080f6bb209f6f40ff909c4f5c5c97 (patch)
tree2e7a0260d84531bcc58d7965918ecc8df5d678ec /Source/cmGeneratorTarget.cxx
parent9f2dca805c8010636d4be7ef03d96bfc131c9809 (diff)
downloadCMake-dfb025bf126080f6bb209f6f40ff909c4f5c5c97.zip
CMake-dfb025bf126080f6bb209f6f40ff909c4f5c5c97.tar.gz
CMake-dfb025bf126080f6bb209f6f40ff909c4f5c5c97.tar.bz2
Move GetLocationForBuild to cmGeneratorTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx37
1 files changed, 36 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 9fe7922..efb414e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -540,6 +540,41 @@ bool cmGeneratorTarget::IsImported() const
}
//----------------------------------------------------------------------------
+const char* cmGeneratorTarget::GetLocationForBuild() const
+{
+ static std::string location;
+ if(this->IsImported())
+ {
+ location = this->Target->ImportedGetFullPath("", false);
+ return location.c_str();
+ }
+
+ // Now handle the deprecated build-time configuration location.
+ location = this->Target->GetDirectory();
+ const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
+ if(cfgid && strcmp(cfgid, ".") != 0)
+ {
+ location += "/";
+ location += cfgid;
+ }
+
+ if(this->Target->IsAppBundleOnApple())
+ {
+ std::string macdir = this->Target->BuildMacContentDirectory("", "",
+ false);
+ if(!macdir.empty())
+ {
+ location += "/";
+ location += macdir;
+ }
+ }
+ location += "/";
+ location += this->Target->GetFullName("", false);
+ return location.c_str();
+}
+
+
+//----------------------------------------------------------------------------
bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
const std::string& config) const
{
@@ -867,7 +902,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
{
// This is really only for compatibility so we do not need to
// worry about configuration names and output names.
- std::string tLocation = t->Target->GetLocationForBuild();
+ std::string tLocation = t->GetLocationForBuild();
tLocation = cmSystemTools::GetFilenamePath(tLocation);
std::string depLocation = cmSystemTools::GetFilenamePath(dep);
depLocation = cmSystemTools::CollapseFullPath(depLocation);