summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-09 14:59:03 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-01-09 14:59:18 (GMT)
commitdda4232b4dbe5d31c292c1ae363980708957e288 (patch)
tree694ad0eafe5df7f033a569d31ef96760c89e6533 /Modules
parent27d958b34c17bf1fe5a4833f732e3974d7b8609e (diff)
parentccde6f80488cd91d47e00ca97e9b23263f7ef939 (diff)
downloadCMake-dda4232b4dbe5d31c292c1ae363980708957e288.zip
CMake-dda4232b4dbe5d31c292c1ae363980708957e288.tar.gz
CMake-dda4232b4dbe5d31c292c1ae363980708957e288.tar.bz2
Merge topic 'cpack-nuget-readme'
ccde6f8048 CPack/NuGet: Add support for repository tag 2c616e85cf CPack/NuGet: Add support for readme tag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9139
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Internal/CPack/CPack.NuGet.nuspec.in2
-rw-r--r--Modules/Internal/CPack/CPackNuGet.cmake21
2 files changed, 23 insertions, 0 deletions
diff --git a/Modules/Internal/CPack/CPack.NuGet.nuspec.in b/Modules/Internal/CPack/CPack.NuGet.nuspec.in
index d89d69f..4548a59 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@
</metadata>
@_CPACK_NUGET_FILES_TAG@
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index 056d025..67f318a 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 "<repository type=\"${_repo_type}\" url=\"${_repo_url}\"")
+ _cpack_nuget_variable_fallback(_repo_br REPOSITORY_BRANCH)
+ if(_repo_br)
+ string(APPEND _CPACK_NUGET_REPOSITORY_TAG " branch=\"${_repo_br}\"")
+ endif()
+ _cpack_nuget_variable_fallback(_repo_commit REPOSITORY_COMMIT)
+ if(_repo_commit)
+ string(APPEND _CPACK_NUGET_REPOSITORY_TAG " commit=\"${_repo_commit}\"")
+ endif()
+ string(APPEND _CPACK_NUGET_REPOSITORY_TAG " />")
+ else()
+ message(AUTHOR_WARNING "Skip adding the `<repository .../>` element due to missing URL or type")
+ endif()
+
# Handle dependencies
_cpack_nuget_variable_fallback(_deps DEPENDENCIES)
set(_collected_deps)