diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-10-20 18:31:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-08 23:04:37 (GMT) |
commit | 8b0168863ed121c7d9f05e3282e2f59490ff6c42 (patch) | |
tree | de9d3bd38dbccd54dd9e11d03d79840bb1a5babe /Source/cmGeneratorTarget.cxx | |
parent | e0261a1e20f14cc2ca593bb978479b52954397d8 (diff) | |
download | CMake-8b0168863ed121c7d9f05e3282e2f59490ff6c42.zip CMake-8b0168863ed121c7d9f05e3282e2f59490ff6c42.tar.gz CMake-8b0168863ed121c7d9f05e3282e2f59490ff6c42.tar.bz2 |
cmGeneratorTarget: Move GetDirectory from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 278194e..b8a87a2 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -748,7 +748,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const } // Now handle the deprecated build-time configuration location. - location = this->Target->GetDirectory(); + location = this->GetDirectory(); const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR"); if(cfgid && strcmp(cfgid, ".") != 0) { @@ -1434,7 +1434,7 @@ cmGeneratorTarget::GetInstallNameDirForBuildTree( } else { - dir = this->Target->GetDirectory(config); + dir = this->GetDirectory(config); } dir += "/"; return dir; @@ -1735,7 +1735,7 @@ cmGeneratorTarget::GetMacContentDirectory(const std::string& config, bool implib) const { // Start with the output directory for the target. - std::string fpath = this->Target->GetDirectory(config, implib); + std::string fpath = this->GetDirectory(config, implib); fpath += "/"; bool contentOnly = true; if(this->Target->IsFrameworkOnApple()) @@ -2860,7 +2860,7 @@ void cmGeneratorTarget::ComputeTargetManifest( } // Get the directory. - std::string dir = this->Target->GetDirectory(config, false); + std::string dir = this->GetDirectory(config, false); // Add each name. std::string f; @@ -2894,7 +2894,7 @@ void cmGeneratorTarget::ComputeTargetManifest( } if(!impName.empty()) { - f = this->Target->GetDirectory(config, true); + f = this->GetDirectory(config, true); f += "/"; f += impName; gg->AddToManifest(f); @@ -2919,7 +2919,7 @@ std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config, bool implib, bool realname) const { - std::string fpath = this->Target->GetDirectory(config, implib); + std::string fpath = this->GetDirectory(config, implib); fpath += "/"; if(this->Target->IsAppBundleOnApple()) { @@ -4454,6 +4454,26 @@ cmGeneratorTarget::GetLinkInterfaceLibraries(const std::string& config, } //---------------------------------------------------------------------------- +std::string cmGeneratorTarget::GetDirectory(const std::string& config, + bool implib) const +{ + if (this->Target->IsImported()) + { + // Return the directory from which the target is imported. + return + cmSystemTools::GetFilenamePath( + this->Target->ImportedGetFullPath(config, implib)); + } + else if(cmTarget::OutputInfo const* info = + this->Target->GetOutputInfo(config)) + { + // Return the directory in which the target will be built. + return implib? info->ImpDir : info->OutDir; + } + return ""; +} + +//---------------------------------------------------------------------------- void cmGeneratorTarget::ComputeLinkInterfaceLibraries( const std::string& config, |