summaryrefslogtreecommitdiffstats
path: root/Modules/CPackComponent.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-07-06 13:35:06 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-07-06 13:35:06 (GMT)
commit06af626ef2ffb6a8c6b4b91bd372849798426b76 (patch)
treeeeb4f69b960126ff6e590fc07f5c5f92237f31ae /Modules/CPackComponent.cmake
parent7d3fe197f8f4fc486b137a20e1e8b04a085744c2 (diff)
parent9e505285e3c5fc2556d8638c0e0d0228aaeee95d (diff)
downloadCMake-06af626ef2ffb6a8c6b4b91bd372849798426b76.zip
CMake-06af626ef2ffb6a8c6b4b91bd372849798426b76.tar.gz
CMake-06af626ef2ffb6a8c6b4b91bd372849798426b76.tar.bz2
Merge topic 'cpack-ifw-list-variable'
9e505285 CPackIFW: Using cpack_append_list_variable_set_command cd1415b5 CPackComponents: add cpack_append_list_variable_set_command
Diffstat (limited to 'Modules/CPackComponent.cmake')
-rw-r--r--Modules/CPackComponent.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 038a717..6a33086 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -360,6 +360,20 @@ macro(cpack_append_string_variable_set_command var strvar)
endif ()
endmacro()
+# Macro that appends a SET command for the given list variable name (var)
+# to the macro named strvar, but only if the variable named "var"
+# has been defined. It's like add variable, but wrap each item to quotes.
+# The string will eventually be appended to a CPack configuration file.
+macro(cpack_append_list_variable_set_command var strvar)
+ if (DEFINED ${var})
+ string(APPEND ${strvar} "set(${var}")
+ foreach(_val IN LISTS ${var})
+ string(APPEND ${strvar} "\n \"${_val}\"")
+ endforeach()
+ string(APPEND ${strvar} ")\n")
+ endif ()
+endmacro()
+
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been set to true. The string will eventually be