summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-01 18:59:41 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-01 18:59:41 (GMT)
commit8427b8e11c9a98fb7f7875a1153ab4998e61d4c1 (patch)
tree5b24444e6f5666c5b0f66e5c3fb949f94e644ef2
parent8b9cd61337501b6adb36fcd70e13ad59d1a63b34 (diff)
parentea6475334aff57633ad7bb80c013c8953328a909 (diff)
downloadCMake-8427b8e11c9a98fb7f7875a1153ab4998e61d4c1.zip
CMake-8427b8e11c9a98fb7f7875a1153ab4998e61d4c1.tar.gz
CMake-8427b8e11c9a98fb7f7875a1153ab4998e61d4c1.tar.bz2
Merge topic 'aliased-target-properties'
ea647533 Do not report ALIASED_TARGET as always set (#15783)
-rw-r--r--Source/cmGetPropertyCommand.cxx2
-rw-r--r--Tests/AliasTarget/CMakeLists.txt13
2 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 854fdb8..2307e08 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -253,7 +253,7 @@ bool cmGetPropertyCommand::HandleTargetMode()
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(NULL);
}
}
return this->StoreResult(
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt
index 47ccbdc..552c83c 100644
--- a/Tests/AliasTarget/CMakeLists.txt
+++ b/Tests/AliasTarget/CMakeLists.txt
@@ -66,6 +66,11 @@ endif()
add_library(iface INTERFACE)
add_library(Alias::Iface ALIAS iface)
+get_property(_aliased_target_set TARGET foo PROPERTY ALIASED_TARGET SET)
+if(_aliased_target_set)
+ message(SEND_ERROR "ALIASED_TARGET is set for target foo")
+endif()
+
get_target_property(_notAlias1 foo ALIASED_TARGET)
if (NOT DEFINED _notAlias1)
message(SEND_ERROR "_notAlias1 is not defined")
@@ -78,12 +83,6 @@ if (NOT _notAlias1 STREQUAL _notAlias1-NOTFOUND)
endif()
get_property(_notAlias2 TARGET foo PROPERTY ALIASED_TARGET)
-if (NOT DEFINED _notAlias2)
- message(SEND_ERROR "_notAlias2 is not defined")
-endif()
if (_notAlias2)
- message(SEND_ERROR "_notAlias2 is defined, but foo is not an ALIAS")
-endif()
-if (NOT _notAlias2 STREQUAL _notAlias2-NOTFOUND)
- message(SEND_ERROR "_notAlias2 not defined to a -NOTFOUND variant")
+ message(SEND_ERROR "_notAlias2 evaluates to true, but foo is not an ALIAS")
endif()