diff --git a/Modules/Internal/CPack/CPack.NuGet.nuspec.in b/Modules/Internal/CPack/CPack.NuGet.nuspec.in index d89d69ff08..4548a5933c 100644 --- a/Modules/Internal/CPack/CPack.NuGet.nuspec.in +++ b/Modules/Internal/CPack/CPack.NuGet.nuspec.in @@ -15,12 +15,14 @@ @_CPACK_NUGET_LICENSE_TAG@ @_CPACK_NUGET_ICONURL_TAG@ @_CPACK_NUGET_ICON_TAG@ + @_CPACK_NUGET_README_TAG@ @_CPACK_NUGET_REQUIRELICENSEACCEPTANCE_TAG@ @_CPACK_NUGET_SUMMARY_TAG@ @_CPACK_NUGET_RELEASENOTES_TAG@ @_CPACK_NUGET_COPYRIGHT_TAG@ @_CPACK_NUGET_LANGUAGE_TAG@ @_CPACK_NUGET_TAGS_TAG@ + @_CPACK_NUGET_REPOSITORY_TAG@ @_CPACK_NUGET_DEPENDENCIES_TAG@ @_CPACK_NUGET_FILES_TAG@ diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake index 056d025ed6..67f318a805 100644 --- a/Modules/Internal/CPack/CPackNuGet.cmake +++ b/Modules/Internal/CPack/CPackNuGet.cmake @@ -294,6 +294,27 @@ function(_cpack_nuget_render_spec) # attributes: "type", "url", "branch", and "commit". While all fields are # considered optional, they are not independent. Currently unsupported. + # NuGet >= 5.10 + _cpack_nuget_variable_fallback_and_wrap_into_element(readme README) + + set(_CPACK_NUGET_REPOSITORY_TAG) + _cpack_nuget_variable_fallback(_repo_type REPOSITORY_TYPE) + _cpack_nuget_variable_fallback(_repo_url REPOSITORY_URL) + if(_repo_type AND _repo_url) + set(_CPACK_NUGET_REPOSITORY_TAG "") + else() + message(AUTHOR_WARNING "Skip adding the `` element due to missing URL or type") + endif() + # Handle dependencies _cpack_nuget_variable_fallback(_deps DEPENDENCIES) set(_collected_deps)