summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/set_property/LINK_LIBRARIES.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-08 17:14:37 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-08 17:23:16 (GMT)
commit7aa9e80e35f62ec5686d08b49ebe8b57cbc6cbc6 (patch)
treeedd7720bb6887c86b3dca7754662ab6335dba1db /Tests/RunCMake/set_property/LINK_LIBRARIES.cmake
parenta6916a6c6e397bda8b381f65dbfc59d3c52f8525 (diff)
downloadCMake-7aa9e80e35f62ec5686d08b49ebe8b57cbc6cbc6.zip
CMake-7aa9e80e35f62ec5686d08b49ebe8b57cbc6cbc6.tar.gz
CMake-7aa9e80e35f62ec5686d08b49ebe8b57cbc6cbc6.tar.bz2
set_property: Fix crash when setting LINK_LIBRARIES to nothing
We use a special dedicated structure to store the LINK_LIBRARIES target property. Do not try to construct a string from a NULL value. Instead leave the property structure empty when no value is given. Reported-by: Ghyslain Leclerc <ghleclerc@gmail.com>
Diffstat (limited to 'Tests/RunCMake/set_property/LINK_LIBRARIES.cmake')
-rw-r--r--Tests/RunCMake/set_property/LINK_LIBRARIES.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/set_property/LINK_LIBRARIES.cmake b/Tests/RunCMake/set_property/LINK_LIBRARIES.cmake
new file mode 100644
index 0000000..994e874
--- /dev/null
+++ b/Tests/RunCMake/set_property/LINK_LIBRARIES.cmake
@@ -0,0 +1,7 @@
+add_custom_target(CustomTarget)
+set_property(TARGET CustomTarget PROPERTY LINK_LIBRARIES)
+set_property(TARGET CustomTarget APPEND PROPERTY LINK_LIBRARIES)
+get_property(val TARGET CustomTarget PROPERTY LINK_LIBRARIES)
+if (NOT "${val}" STREQUAL "")
+ message(FATAL_ERROR "LINK_LIBRARIES value is '${val}' but should be ''")
+endif()