summaryrefslogtreecommitdiffstats
path: root/Modules/CPackComponent.cmake
diff options
context:
space:
mode:
authorDeniz Bahadir <deniz@code.bahadir.email>2022-05-24 17:07:36 (GMT)
committerDeniz Bahadir <deniz@code.bahadir.email>2022-05-24 17:07:36 (GMT)
commit11ac6751a81a3809923f0269aba3db48042ba9be (patch)
tree63d85b323312c134a112b7973068e7858eed072e /Modules/CPackComponent.cmake
parentced9a3b0bbc85fbd392b7323b18d00309a444ddc (diff)
downloadCMake-11ac6751a81a3809923f0269aba3db48042ba9be.zip
CMake-11ac6751a81a3809923f0269aba3db48042ba9be.tar.gz
CMake-11ac6751a81a3809923f0269aba3db48042ba9be.tar.bz2
CPack: Support component names with special characters, too
The macros `cpack_append_variable_set_command` and `cpack_append_string_variable_set_command` became functions, in order to support arguments with special characters (e.g. `:`).
Diffstat (limited to 'Modules/CPackComponent.cmake')
-rw-r--r--Modules/CPackComponent.cmake18
1 files changed, 10 insertions, 8 deletions
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 1f8c38c..8ca9f28 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -327,32 +327,34 @@ OS X.
if(NOT CPackComponent_CMake_INCLUDED)
set(CPackComponent_CMake_INCLUDED 1)
-# Macro that appends a SET command for the given variable name (var)
-# to the macro named strvar, but only if the variable named "var"
+# Function that appends a SET command for the given variable name (var)
+# to the string named strvar, but only if the variable named "var"
# has been defined. The string will eventually be appended to a CPack
# configuration file.
-macro(cpack_append_variable_set_command var strvar)
+function(cpack_append_variable_set_command var strvar)
if (DEFINED ${var})
string(APPEND ${strvar} "set(${var}")
foreach(APPENDVAL ${${var}})
string(APPEND ${strvar} " ${APPENDVAL}")
endforeach()
string(APPEND ${strvar} ")\n")
+ set(${strvar} "${${strvar}}" PARENT_SCOPE)
endif ()
-endmacro()
+endfunction()
-# Macro that appends a SET command for the given variable name (var)
-# to the macro named strvar, but only if the variable named "var"
+# Function that appends a SET command for the given variable name (var)
+# to the string named strvar, but only if the variable named "var"
# has been defined and is a string. The string will eventually be
# appended to a CPack configuration file.
-macro(cpack_append_string_variable_set_command var strvar)
+function(cpack_append_string_variable_set_command var strvar)
if (DEFINED ${var})
list(LENGTH ${var} CPACK_APP_VALUE_LEN)
if(${CPACK_APP_VALUE_LEN} EQUAL 1)
string(APPEND ${strvar} "set(${var} \"${${var}}\")\n")
endif()
+ set(${strvar} "${${strvar}}" PARENT_SCOPE)
endif ()
-endmacro()
+endfunction()
# 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"