CPack/NuGet: Restore component packaging on Windows

The change from `\` to `/` in commit dade75509f (CPack/NuGet: Fix nuspec
file generation for UNIX-style OS, 2020-12-21, v3.20.0-rc1~243^2) does
not work on Windows.  Use `cmake_path` to form a path to an image
directory with preinstalled files.

Fixes: #22489
This commit is contained in:
Alex Turbov
2022-05-18 18:36:14 +04:00
committed by Brad King
parent 640268c19b
commit 066ff258db

View File

@@ -332,7 +332,9 @@ endfunction()
function(_cpack_nuget_make_files_tag)
set(_files)
foreach(_comp IN LISTS ARGN)
string(APPEND _files " <file src=\"${_comp}/**\" target=\".\" />\n")
cmake_path(APPEND _comp "**")
cmake_path(NATIVE_PATH _comp _comp)
string(APPEND _files " <file src=\"${_comp}\" target=\".\" />\n")
endforeach()
set(_CPACK_NUGET_FILES_TAG "<files>\n${_files} </files>" PARENT_SCOPE)
endfunction()