summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-08 12:55:46 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:36 (GMT)
commitf154475b65738444414312d7d5a255f3220d90c6 (patch)
treeb5a619eb570bfd4be813af7283c58be727e52624 /Source/cmTarget.cxx
parentcfc2cf9559eacbf45d04249ee1dd7f75bb0cdff0 (diff)
downloadCMake-f154475b65738444414312d7d5a255f3220d90c6.zip
CMake-f154475b65738444414312d7d5a255f3220d90c6.tar.gz
CMake-f154475b65738444414312d7d5a255f3220d90c6.tar.bz2
cmTarget: Refactor GetLocation API
When given a non-NULL configuration the GetLocation returned the location for the given configuration. When given a NULL configuration the GetLocation method returned a location with the build-system placeholder for the configuration name. Split the latter use case out into a separate GetLocationForBuild method and update call sites accordingly.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx25
1 files changed, 9 insertions, 16 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 99f2c1f..3273437 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2458,32 +2458,25 @@ std::string cmTarget::GetCompilePDBDirectory(const char* config) const
//----------------------------------------------------------------------------
const char* cmTarget::GetLocation(const char* config) const
{
+ static std::string location;
if (this->IsImported())
{
- return this->ImportedGetLocation(config);
+ location = this->ImportedGetFullPath(config, false);
}
else
{
- return this->NormalGetLocation(config);
+ location = this->GetFullPath(config, false);
}
-}
-
-//----------------------------------------------------------------------------
-const char* cmTarget::ImportedGetLocation(const char* config) const
-{
- static std::string location;
- location = this->ImportedGetFullPath(config, false);
return location.c_str();
}
//----------------------------------------------------------------------------
-const char* cmTarget::NormalGetLocation(const char* config) const
+const char* cmTarget::GetLocationForBuild() const
{
static std::string location;
- // Handle the configuration-specific case first.
- if(config)
+ if(this->IsImported())
{
- location = this->GetFullPath(config, false);
+ location = this->ImportedGetFullPath("", false);
return location.c_str();
}
@@ -2503,7 +2496,7 @@ const char* cmTarget::NormalGetLocation(const char* config) const
if(this->IsAppBundleOnApple())
{
- std::string macdir = this->BuildMacContentDirectory("", config, false);
+ std::string macdir = this->BuildMacContentDirectory("", "", false);
if(!macdir.empty())
{
location += "/";
@@ -2511,7 +2504,7 @@ const char* cmTarget::NormalGetLocation(const char* config) const
}
}
location += "/";
- location += this->GetFullName(config, false);
+ location += this->GetFullName("", false);
return location.c_str();
}
@@ -2659,7 +2652,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
// cannot take into account the per-configuration name of the
// target because the configuration type may not be known at
// CMake time.
- this->Properties.SetProperty("LOCATION", this->GetLocation(0),
+ this->Properties.SetProperty("LOCATION", this->GetLocationForBuild(),
cmProperty::TARGET);
}