summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2012-07-16 17:44:19 (GMT)
committerPeter Kümmel <syntheticpp@gmx.net>2012-07-17 12:03:11 (GMT)
commitf8e0a5109f104e894f450049a6c97f53bd378dae (patch)
treedeb7f5773d699173cb359f8ec533da62c2b2dc04
parentf36c7b0bbe79592c7540740fe9cef747346ae2a4 (diff)
downloadCMake-f8e0a5109f104e894f450049a6c97f53bd378dae.zip
CMake-f8e0a5109f104e894f450049a6c97f53bd378dae.tar.gz
CMake-f8e0a5109f104e894f450049a6c97f53bd378dae.tar.bz2
Re-factor framework directory computation.
-rw-r--r--Source/cmTarget.cxx26
-rw-r--r--Source/cmTarget.h3
2 files changed, 17 insertions, 12 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 490acb6..775662c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3688,10 +3688,7 @@ std::string cmTarget::GetInstallNameDirForBuildTree(const char* config,
dir += "/";
if(this->IsFrameworkOnApple() && !for_xcode)
{
- dir += this->GetFullName(config, false);
- dir += ".framework/Versions/";
- dir += this->GetFrameworkVersion();
- dir += "/";
+ dir += this->GetFrameworkDirectory(config);
}
return dir;
}
@@ -3722,10 +3719,7 @@ std::string cmTarget::GetInstallNameDirForInstallTree(const char* config,
if(this->IsFrameworkOnApple() && !for_xcode)
{
- dir += this->GetFullName(config, false);
- dir += ".framework/Versions/";
- dir += this->GetFrameworkVersion();
- dir += "/";
+ dir += this->GetFrameworkDirectory(config);
}
return dir;
@@ -4715,6 +4709,17 @@ std::vector<std::string> cmTarget::GetIncludeDirectories()
}
//----------------------------------------------------------------------------
+std::string cmTarget::GetFrameworkDirectory(const char* config)
+{
+ std::string fpath;
+ fpath += this->GetFullName(config, false);
+ fpath += ".framework/Versions/";
+ fpath += this->GetFrameworkVersion();
+ fpath += "/";
+ return fpath;
+}
+
+//----------------------------------------------------------------------------
std::string cmTarget::BuildMacContentDirectory(const std::string& base,
const char* config,
bool includeMacOS)
@@ -4729,10 +4734,7 @@ std::string cmTarget::BuildMacContentDirectory(const std::string& base,
}
if(this->IsFrameworkOnApple())
{
- fpath += this->GetFullName(config, false);
- fpath += ".framework/Versions/";
- fpath += this->GetFrameworkVersion();
- fpath += "/";
+ fpath += this->GetFrameworkDirectory(config);
}
if(this->IsCFBundleOnApple())
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index aa14049..a89c5d9 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -478,6 +478,9 @@ public:
/** @return whether this target have a well defined output file name. */
bool HaveWellDefinedOutputFiles();
+ /** @return the Mac framework directory without the base. */
+ std::string GetFrameworkDirectory(const char* config = 0);
+
private:
/**
* A list of direct dependencies. Use in conjunction with DependencyMap.