diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-04 17:19:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-05 16:20:47 (GMT) |
commit | 89e2a080e977b9632fa13c627b6a5370250d6ed5 (patch) | |
tree | ae24e3f07d12be05b42e80d878b8177bae84bf8a | |
parent | 62720e44be3e9f28e4c1e7d38206b2c51d34745e (diff) | |
download | CMake-89e2a080e977b9632fa13c627b6a5370250d6ed5.zip CMake-89e2a080e977b9632fa13c627b6a5370250d6ed5.tar.gz CMake-89e2a080e977b9632fa13c627b6a5370250d6ed5.tar.bz2 |
cmGeneratorTarget: Move GetMacContentDirectory from cmTarget.
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 45 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 9 | ||||
-rw-r--r-- | Source/cmOSXBundleGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 39 | ||||
-rw-r--r-- | Source/cmTarget.h | 8 |
5 files changed, 53 insertions, 50 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 4be034f..45577e5 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -567,7 +567,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const if(this->Target->IsAppBundleOnApple()) { - std::string macdir = this->Target->BuildMacContentDirectory("", "", + std::string macdir = this->BuildMacContentDirectory("", "", false); if(!macdir.empty()) { @@ -902,6 +902,47 @@ void cmGeneratorTarget::GetFullNameComponents(std::string& prefix, //---------------------------------------------------------------------------- std::string +cmGeneratorTarget::BuildMacContentDirectory(const std::string& base, + const std::string& config, + bool contentOnly) const +{ + std::string fpath = base; + if(this->Target->IsAppBundleOnApple()) + { + fpath += this->Target->GetAppBundleDirectory(config, contentOnly); + } + if(this->Target->IsFrameworkOnApple()) + { + fpath += this->Target->GetFrameworkDirectory(config, contentOnly); + } + if(this->Target->IsCFBundleOnApple()) + { + fpath += this->Target->GetCFBundleDirectory(config, contentOnly); + } + return fpath; +} + +//---------------------------------------------------------------------------- +std::string +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); + fpath += "/"; + bool contentOnly = true; + if(this->Target->IsFrameworkOnApple()) + { + // additional files with a framework go into the version specific + // directory + contentOnly = false; + } + fpath = this->BuildMacContentDirectory(fpath, config, contentOnly); + return fpath; +} + +//---------------------------------------------------------------------------- +std::string cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const { std::string data; @@ -1527,7 +1568,7 @@ std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config, fpath += "/"; if(this->Target->IsAppBundleOnApple()) { - fpath = this->Target->BuildMacContentDirectory(fpath, config, false); + fpath = this->BuildMacContentDirectory(fpath, config, false); fpath += "/"; } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index f96adad..8fc1b44 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -123,6 +123,15 @@ public: const std::string& config="", bool implib = false) const; + /** Append to @a base the mac content directory and return it. */ + std::string BuildMacContentDirectory(const std::string& base, + const std::string& config = "", + bool contentOnly = true) const; + + /** @return the mac content directory for this target. */ + std::string GetMacContentDirectory(const std::string& config = 0, + bool implib = false) const; + cmTarget* Target; cmMakefile* Makefile; cmLocalGenerator* LocalGenerator; diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index 3bc0eb7..7df2f78 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -217,7 +217,7 @@ cmOSXBundleGenerator::InitMacOSXContentDirectory(const char* pkgloc) // Construct the full path to the content subdirectory. std::string macdir = - this->GT->Target->GetMacContentDirectory(this->ConfigName, + this->GT->GetMacContentDirectory(this->ConfigName, /*implib*/ false); macdir += "/"; macdir += pkgloc; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 0d9aa49..0f1d309 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -5401,45 +5401,6 @@ std::string cmTarget::GetAppBundleDirectory(const std::string& config, } //---------------------------------------------------------------------------- -std::string cmTarget::BuildMacContentDirectory(const std::string& base, - const std::string& config, - bool contentOnly) const -{ - std::string fpath = base; - if(this->IsAppBundleOnApple()) - { - fpath += this->GetAppBundleDirectory(config, contentOnly); - } - if(this->IsFrameworkOnApple()) - { - fpath += this->GetFrameworkDirectory(config, contentOnly); - } - if(this->IsCFBundleOnApple()) - { - fpath += this->GetCFBundleDirectory(config, contentOnly); - } - return fpath; -} - -//---------------------------------------------------------------------------- -std::string cmTarget::GetMacContentDirectory(const std::string& config, - bool implib) const -{ - // Start with the output directory for the target. - std::string fpath = this->GetDirectory(config, implib); - fpath += "/"; - bool contentOnly = true; - if(this->IsFrameworkOnApple()) - { - // additional files with a framework go into the version specific - // directory - contentOnly = false; - } - fpath = this->BuildMacContentDirectory(fpath, config, contentOnly); - return fpath; -} - -//---------------------------------------------------------------------------- cmTargetInternalPointer::cmTargetInternalPointer() { this->Pointer = new cmTargetInternals; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 9962fdb..d03ba3b 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -471,10 +471,6 @@ public: directory. */ bool UsesDefaultOutputDir(const std::string& config, bool implib) const; - /** @return the mac content directory for this target. */ - std::string GetMacContentDirectory(const std::string& config, - bool implib) const; - /** @return whether this target have a well defined output file name. */ bool HaveWellDefinedOutputFiles() const; @@ -615,10 +611,6 @@ private: std::string ImportedGetFullPath(const std::string& config, bool implib) const; - /** Append to @a base the mac content directory and return it. */ - std::string BuildMacContentDirectory(const std::string& base, - const std::string& config, - bool contentOnly) const; void GetSourceFiles(std::vector<std::string> &files, const std::string& config) const; |