summaryrefslogtreecommitdiffstats
path: root/Source/cmGetTargetPropertyCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-08 20:20:38 (GMT)
committerBrad King <brad.king@kitware.com>2015-01-11 16:43:58 (GMT)
commit34a990946c655a0be69e4168461c5e23a2d64bfa (patch)
treefe815b5f8ec9c54488fe0539790fabbbc16b1890 /Source/cmGetTargetPropertyCommand.cxx
parentc118816d44e178e4364a0c32aaece81a14511237 (diff)
downloadCMake-34a990946c655a0be69e4168461c5e23a2d64bfa.zip
CMake-34a990946c655a0be69e4168461c5e23a2d64bfa.tar.gz
CMake-34a990946c655a0be69e4168461c5e23a2d64bfa.tar.bz2
get_target_property: discern empty from undefined properties (#15333)
This was accidentally regressed by commit v3.1.0-rc1~812^2~50 (stringapi: Use strings for property names, 2013-09-02).
Diffstat (limited to 'Source/cmGetTargetPropertyCommand.cxx')
-rw-r--r--Source/cmGetTargetPropertyCommand.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index aa6f0c1..fb59df8 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -23,6 +23,7 @@ bool cmGetTargetPropertyCommand
std::string var = args[0];
const std::string& targetName = args[1];
std::string prop;
+ bool prop_exists = false;
if(args[2] == "ALIASED_TARGET")
{
@@ -32,6 +33,7 @@ bool cmGetTargetPropertyCommand
this->Makefile->FindTargetToUse(targetName))
{
prop = target->GetName();
+ prop_exists = true;
}
}
}
@@ -42,6 +44,7 @@ bool cmGetTargetPropertyCommand
if(prop_cstr)
{
prop = prop_cstr;
+ prop_exists = true;
}
}
else
@@ -74,7 +77,7 @@ bool cmGetTargetPropertyCommand
}
}
}
- if (!prop.empty())
+ if (prop_exists)
{
this->Makefile->AddDefinition(var, prop.c_str());
return true;