summaryrefslogtreecommitdiffstats
path: root/Modules/Internal/CPack
diff options
context:
space:
mode:
authorYacoub Hossain <yacoub.hossain@autodesk.com>2019-11-23 19:12:36 (GMT)
committerBrad King <brad.king@kitware.com>2019-12-06 14:14:36 (GMT)
commit161a19e54717a837918519c0e29ad5f3c2590200 (patch)
tree71f19af2197bf2a4747dd62646afa1d6185fb0b9 /Modules/Internal/CPack
parent6462505b3b0614119d022ebadf60c3962551efb7 (diff)
downloadCMake-161a19e54717a837918519c0e29ad5f3c2590200.zip
CMake-161a19e54717a837918519c0e29ad5f3c2590200.tar.gz
CMake-161a19e54717a837918519c0e29ad5f3c2590200.tar.bz2
CPackNuGet: Fix handling of version specs with '['
Build a string directly to avoid depending on CMake lists which do not handle square brackets in values very well. Fixes: #20010
Diffstat (limited to 'Modules/Internal/CPack')
-rw-r--r--Modules/Internal/CPack/CPackNuGet.cmake11
1 files changed, 2 insertions, 9 deletions
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index b46a7b1..1f4bcfd 100644
--- a/Modules/Internal/CPack/CPackNuGet.cmake
+++ b/Modules/Internal/CPack/CPackNuGet.cmake
@@ -239,20 +239,13 @@ function(_cpack_nuget_render_spec)
if(_ver)
_cpack_nuget_debug(" got `${_dep}` dependency version ${_ver}")
- list(APPEND _collected_deps "<dependency id=\"${_dep}\" version=\"${_ver}\" />")
+ string(CONCAT _collected_deps "${_collected_deps}" " <dependency id=\"${_dep}\" version=\"${_ver}\" />\n")
endif()
endforeach()
# Render deps into the variable
if(_collected_deps)
- set(_CPACK_NUGET_DEPENDENCIES_TAG "<dependencies>\n")
- foreach(_line IN LISTS _collected_deps)
- string(
- APPEND _CPACK_NUGET_DEPENDENCIES_TAG
- " ${_line}\n"
- )
- endforeach()
- string(APPEND _CPACK_NUGET_DEPENDENCIES_TAG " </dependencies>")
+ string(CONCAT _CPACK_NUGET_DEPENDENCIES_TAG "<dependencies>\n" "${_collected_deps}" " </dependencies>")
endif()
# Render the spec file