summaryrefslogtreecommitdiffstats
path: root/Source/cmGetPropertyCommand.cxx
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2016-06-26 20:00:00 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2016-06-26 20:00:00 (GMT)
commit2ca76a6651dd16586334067f6a41524a4015adc9 (patch)
tree3b166af5ccf81ef640bf03dad6fc97f129e063b0 /Source/cmGetPropertyCommand.cxx
parentc68cf9e4d111fa7c92973acec92d71ce6d187ff9 (diff)
downloadCMake-2ca76a6651dd16586334067f6a41524a4015adc9.zip
CMake-2ca76a6651dd16586334067f6a41524a4015adc9.tar.gz
CMake-2ca76a6651dd16586334067f6a41524a4015adc9.tar.bz2
Validate target name in ALIASED_TARGET property getter
Diffstat (limited to 'Source/cmGetPropertyCommand.cxx')
-rw-r--r--Source/cmGetPropertyCommand.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 06f7504..67b0e9d 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -248,15 +248,14 @@ bool cmGetPropertyCommand::HandleTargetMode()
return false;
}
- if (this->PropertyName == "ALIASED_TARGET") {
- if (this->Makefile->IsAlias(this->Name)) {
- if (cmTarget* target = this->Makefile->FindTargetToUse(this->Name)) {
+ if (cmTarget* target = this->Makefile->FindTargetToUse(this->Name)) {
+ if (this->PropertyName == "ALIASED_TARGET") {
+ if (this->Makefile->IsAlias(this->Name)) {
return this->StoreResult(target->GetName().c_str());
+ } else {
+ return this->StoreResult((this->Variable + "-NOTFOUND").c_str());
}
}
- return this->StoreResult((this->Variable + "-NOTFOUND").c_str());
- }
- if (cmTarget* target = this->Makefile->FindTargetToUse(this->Name)) {
return this->StoreResult(
target->GetProperty(this->PropertyName, this->Makefile));
} else {