From 5ab3a946518870d0dbd1fe606d1bc89d336769c4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 25 Jul 2015 21:06:37 +0200 Subject: cmTarget: Inline GetLocation into deprecated callers. --- Source/cmTarget.cxx | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index da57c4c..352b2de 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2917,11 +2917,21 @@ const char *cmTarget::GetProperty(const std::string& prop, // For an imported target this is the location of an arbitrary // available configuration. // - // For a non-imported target this is deprecated because it - // 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(propLOCATION, this->GetLocationForBuild()); + if(this->IsImported()) + { + this->Properties.SetProperty( + propLOCATION, this->ImportedGetFullPath("", false).c_str()); + } + else + { + // For a non-imported target this is deprecated because it + // 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( + propLOCATION, this->GetLocationForBuild()); + } + } // Support "LOCATION_". @@ -2932,7 +2942,17 @@ const char *cmTarget::GetProperty(const std::string& prop, return 0; } const char* configName = prop.c_str() + 9; - this->Properties.SetProperty(prop, this->GetLocation(configName)); + + if (this->IsImported()) + { + this->Properties.SetProperty( + prop, this->ImportedGetFullPath(configName, false).c_str()); + } + else + { + this->Properties.SetProperty( + prop, this->GetFullPath(configName, false).c_str()); + } } // Support "_LOCATION". else if(cmHasLiteralSuffix(prop, "_LOCATION")) @@ -2944,7 +2964,16 @@ const char *cmTarget::GetProperty(const std::string& prop, { return 0; } - this->Properties.SetProperty(prop, this->GetLocation(configName)); + if (this->IsImported()) + { + this->Properties.SetProperty( + prop, this->ImportedGetFullPath(configName, false).c_str()); + } + else + { + this->Properties.SetProperty( + prop, this->GetFullPath(configName, false).c_str()); + } } } } -- cgit v0.12