CPack: Mismatch between NuGet configuration and current NuGet spec
The immediate issue is that generating NuGet packages with the current version of CMake/CPack results in the warning:
WARNING: NU5125: The 'licenseUrl' element will be deprecated. Consider using the 'license' element instead.
More information is available at https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5125 but the simple solution would be to specify license
instead of licenseUrl
Unfortunately, it does not seem possible to specify additional fields in a project's generated CPack.NuGet.nuspec
file; the template file has no provisions for adding fields beyond those listed on https://cmake.org/cmake/help/latest/cpack_gen/nuget.html See CMake/share/cmake-3.18/Modules/Internal/CPack/CPack.NuGet.nuspec.in
A more robust solution would be to extend CMake's list of allowed variables/attributes based on a review of the current .nuspec
reference at https://docs.microsoft.com/en-us/nuget/reference/nuspec
My goal is to use CMake to specify the minimum current set of required attributes of a NuGet package that will allow the package to be uploaded to nuget.org. Package submission is currently failing on a missing license field. It's not clear that's the only issue preventing submission and it seems that a full review and synchronization with the .nuspec
reference is warranted.
A fix seems tedious but not necessarily complex. If it helps, I can provide a first pass comparison between the .nuspec
reference and the currently available CMake variables.