diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index c07fd0f24..17c8a4d82 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2673,7 +2673,7 @@ const char *cmTarget::GetProperty(const std::string& prop, // Support "_LOCATION". if(cmHasLiteralSuffix(prop, "_LOCATION")) { - std::string configName(prop, strlen(prop) - 9); + std::string configName(prop.c_str(), prop.size() - 9); if(configName != "IMPORTED") { if (!this->HandleLocationPropertyPolicy()) @@ -2681,7 +2681,7 @@ const char *cmTarget::GetProperty(const std::string& prop, return 0; } this->Properties.SetProperty(prop, - this->GetLocation(configName.c_str()), + this->GetLocation(configName), cmProperty::TARGET); } }