summaryrefslogtreecommitdiff
path: root/Tests/Properties
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-07-13 23:14:41 +0200
committerAlex Neundorf <neundorf@kde.org>2011-07-15 20:57:33 +0200
commit9dbba1b46421d4c45f7090f4573df6e73afccf69 (patch)
treeb4c6a0985d675a6e1e0fd4123608e5a6a36ae235 /Tests/Properties
parent37340687a4d779320d7778cb62fdfd384fa32f9a (diff)
downloadcmake-9dbba1b46421d4c45f7090f4573df6e73afccf69.tar.gz
Fix #12342: Add APPEND_STRING option to set_property()
set_property() has APPEND, which creates a list. E.g. when appending to COMPILE_FLAGS a string is needed, not a list. With the APPEND_STRING option the value is append as string, not as list. Alex
Diffstat (limited to 'Tests/Properties')
-rw-r--r--Tests/Properties/CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt
index e0c752297c..c1bc3b9e35 100644
--- a/Tests/Properties/CMakeLists.txt
+++ b/Tests/Properties/CMakeLists.txt
@@ -71,6 +71,24 @@ if (NOT TARGETRESULT)
"Error: target result is TARGETRESULT=${TARGETRESULT}")
endif (NOT TARGETRESULT)
+# test APPEND and APPEND_STRING set_property()
+set_property(TARGET Properties PROPERTY FOO foo)
+set_property(TARGET Properties PROPERTY BAR bar)
+set_property(TARGET Properties APPEND PROPERTY FOO 123)
+set_property(TARGET Properties APPEND_STRING PROPERTY BAR 456)
+
+get_property(APPEND_RESULT TARGET Properties PROPERTY FOO)
+if (NOT "${APPEND_RESULT}" STREQUAL "foo;123")
+ message(SEND_ERROR
+ "Error: target result is APPEND_RESULT=${APPEND_RESULT}")
+endif ()
+
+get_property(APPEND_STRING_RESULT TARGET Properties PROPERTY BAR)
+if (NOT "${APPEND_STRING_RESULT}" STREQUAL "bar456")
+ message(SEND_ERROR
+ "Error: target result is APPEND_STRING_RESULT=${APPEND_STRING_RESULT}")
+endif ()
+
# test get_property SET
get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET)
if (NOT TARGETRESULT)