mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-14 10:19:56 -06:00
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
This commit is contained in:
committed by
Brad King
parent
6462505b3b
commit
161a19e547
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user