nuget.rst 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. CPack NuGet Generator
  2. ---------------------
  3. .. versionadded:: 3.12
  4. When build a NuGet package there is no direct way to control an output
  5. filename due a lack of the corresponding CLI option of NuGet, so there
  6. is no :variable:`!CPACK_NUGET_PACKAGE_FILE_NAME` variable. To form the output filename
  7. NuGet uses the package name and the version according to its built-in rules.
  8. Also, be aware that including a top level directory
  9. (:variable:`CPACK_INCLUDE_TOPLEVEL_DIRECTORY`) is ignored by this generator.
  10. Variables specific to CPack NuGet generator
  11. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  12. The CPack NuGet generator may be used to create NuGet packages using
  13. :module:`CPack`. The CPack NuGet generator is a :module:`CPack` generator thus
  14. it uses the :variable:`!CPACK_XXX` variables used by :module:`CPack`.
  15. The CPack NuGet generator has specific features which are controlled by the
  16. specifics :variable:`!CPACK_NUGET_XXX` variables. In the "one per group" mode
  17. (see :variable:`CPACK_COMPONENTS_GROUPING`), ``<compName>`` placeholder
  18. in the variables below would contain a group name (uppercased and turned into
  19. a "C" identifier).
  20. List of CPack NuGet generator specific variables:
  21. .. variable:: CPACK_NUGET_COMPONENT_INSTALL
  22. Enable component packaging for CPack NuGet generator
  23. :Mandatory: No
  24. :Default: ``OFF``
  25. .. variable:: CPACK_NUGET_PACKAGE_NAME
  26. CPACK_NUGET_<compName>_PACKAGE_NAME
  27. The NUGET package name. ``CPACK_NUGET_PACKAGE_NAME`` is used as the
  28. package ``id`` on nuget.org_
  29. :Mandatory: Yes
  30. :Default: :variable:`CPACK_PACKAGE_NAME`
  31. .. variable:: CPACK_NUGET_PACKAGE_VERSION
  32. CPACK_NUGET_<compName>_PACKAGE_VERSION
  33. The NuGet package version.
  34. :Mandatory: Yes
  35. :Default: :variable:`CPACK_PACKAGE_VERSION`
  36. .. variable:: CPACK_NUGET_PACKAGE_DESCRIPTION
  37. CPACK_NUGET_<compName>_PACKAGE_DESCRIPTION
  38. A long description of the package for UI display.
  39. :Mandatory: Yes
  40. :Default:
  41. - :variable:`CPACK_COMPONENT_<compName>_DESCRIPTION`,
  42. - :variable:`!CPACK_COMPONENT_GROUP_<groupName>_DESCRIPTION`,
  43. - :variable:`CPACK_PACKAGE_DESCRIPTION`
  44. .. variable:: CPACK_NUGET_PACKAGE_AUTHORS
  45. CPACK_NUGET_<compName>_PACKAGE_AUTHORS
  46. A comma-separated list of packages authors, matching the profile names
  47. on nuget.org_. These are displayed in the NuGet Gallery on
  48. nuget.org_ and are used to cross-reference packages by the same
  49. authors.
  50. :Mandatory: Yes
  51. :Default: :variable:`CPACK_PACKAGE_VENDOR`
  52. .. variable:: CPACK_NUGET_PACKAGE_TITLE
  53. CPACK_NUGET_<compName>_PACKAGE_TITLE
  54. A human-friendly title of the package, typically used in UI displays
  55. as on nuget.org_ and the Package Manager in Visual Studio. If not
  56. specified, the package ID is used.
  57. :Mandatory: No
  58. :Default:
  59. - :variable:`CPACK_COMPONENT_<compName>_DISPLAY_NAME`,
  60. - :variable:`!CPACK_COMPONENT_GROUP_<groupName>_DISPLAY_NAME`
  61. .. variable:: CPACK_NUGET_PACKAGE_OWNERS
  62. CPACK_NUGET_<compName>_PACKAGE_OWNERS
  63. A comma-separated list of the package creators using profile names
  64. on nuget.org_. This is often the same list as in authors,
  65. and is ignored when uploading the package to nuget.org_.
  66. :Mandatory: No
  67. :Default: None
  68. .. variable:: CPACK_NUGET_PACKAGE_HOMEPAGE_URL
  69. CPACK_NUGET_<compName>_PACKAGE_HOMEPAGE_URL
  70. An URL for the package's home page, often shown in UI displays as well
  71. as nuget.org_.
  72. :Mandatory: No
  73. :Default: :variable:`CPACK_PACKAGE_HOMEPAGE_URL`
  74. .. variable:: CPACK_NUGET_PACKAGE_LICENSEURL
  75. CPACK_NUGET_<compName>_PACKAGE_LICENSEURL
  76. .. deprecated:: 3.20
  77. Use a local license file
  78. (:variable:`CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME`)
  79. or a `SPDX license identifier`_
  80. (:variable:`CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION`) instead.
  81. An URL for the package's license, often shown in UI displays as well
  82. as on nuget.org_.
  83. :Mandatory: No
  84. :Default: None
  85. .. variable:: CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION
  86. CPACK_NUGET_<compName>_PACKAGE_LICENSE_EXPRESSION
  87. .. versionadded:: 3.20
  88. A Software Package Data Exchange `SPDX license identifier`_ such as
  89. ``MIT``, ``BSD-3-Clause``, or ``LGPL-3.0-or-later``. In the case of a
  90. choice of licenses or more complex restrictions, compound license
  91. expressions may be formed using boolean operators, for example
  92. ``MIT OR BSD-3-Clause``. See the `SPDX specification`_ for guidance
  93. on forming complex license expressions.
  94. If :variable:`CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME` is specified,
  95. :variable:`!CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION` is ignored.
  96. :Mandatory: No
  97. :Default: None
  98. .. variable:: CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME
  99. CPACK_NUGET_<compName>_PACKAGE_LICENSE_FILE_NAME
  100. The package's license file in :file:`.txt` or :file:`.md` format.
  101. If :variable:`!CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME` is specified,
  102. :variable:`!CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION` is ignored.
  103. .. versionadded:: 3.20
  104. :Mandatory: No
  105. :Default: None
  106. .. variable:: CPACK_NUGET_PACKAGE_ICONURL
  107. CPACK_NUGET_<compName>_PACKAGE_ICONURL
  108. .. deprecated:: 3.20
  109. Use a local icon file (:variable:`CPACK_NUGET_PACKAGE_ICON`) instead.
  110. An URL for a 64x64 image with transparency background to use as the
  111. icon for the package in UI display.
  112. :Mandatory: No
  113. :Default: None
  114. .. variable:: CPACK_NUGET_PACKAGE_REQUIRE_LICENSE_ACCEPTANCE
  115. When set to a true value, the user will be prompted to accept the license
  116. before installing the package.
  117. :Mandatory: No
  118. :Default: None
  119. .. variable:: CPACK_NUGET_PACKAGE_ICON
  120. CPACK_NUGET_<compName>_PACKAGE_ICON
  121. .. versionadded:: 3.20
  122. The filename of a 64x64 image with transparency background to use as the
  123. icon for the package in UI display.
  124. :Mandatory: No
  125. :Default: None
  126. .. variable:: CPACK_NUGET_PACKAGE_DESCRIPTION_SUMMARY
  127. CPACK_NUGET_<compName>_PACKAGE_DESCRIPTION_SUMMARY
  128. A short description of the package for UI display. If omitted, a
  129. truncated version of description is used.
  130. :Mandatory: No
  131. :Default: :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`
  132. .. variable:: CPACK_NUGET_PACKAGE_RELEASE_NOTES
  133. CPACK_NUGET_<compName>_PACKAGE_RELEASE_NOTES
  134. A description of the changes made in this release of the package,
  135. often used in UI like the Updates tab of the Visual Studio Package
  136. Manager in place of the package description.
  137. :Mandatory: No
  138. :Default: None
  139. .. variable:: CPACK_NUGET_PACKAGE_COPYRIGHT
  140. CPACK_NUGET_<compName>_PACKAGE_COPYRIGHT
  141. Copyright details for the package.
  142. :Mandatory: No
  143. :Default: None
  144. .. variable:: CPACK_NUGET_PACKAGE_LANGUAGE
  145. CPACK_NUGET_<compName>_PACKAGE_LANGUAGE
  146. .. versionadded:: 3.20
  147. Locale specifier for the package, for example ``en_CA``.
  148. :Mandatory: No
  149. :Default: None
  150. .. variable:: CPACK_NUGET_PACKAGE_TAGS
  151. CPACK_NUGET_<compName>_PACKAGE_TAGS
  152. A space-delimited list of tags and keywords that describe the
  153. package and aid discoverability of packages through search and
  154. filtering.
  155. :Mandatory: No
  156. :Default: None
  157. .. variable:: CPACK_NUGET_PACKAGE_DEPENDENCIES
  158. CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES
  159. A list of package dependencies.
  160. :Mandatory: No
  161. :Default: None
  162. .. variable:: CPACK_NUGET_PACKAGE_DEPENDENCIES_<dependency>_VERSION
  163. CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<dependency>_VERSION
  164. A `version specification`_ for the particular dependency, where
  165. ``<dependency>`` is an item of the dependency list (see above)
  166. transformed with :command:`string(MAKE_C_IDENTIFIER)` command.
  167. :Mandatory: No
  168. :Default: None
  169. .. variable:: CPACK_NUGET_PACKAGE_DEBUG
  170. Enable debug messages while executing CPack NuGet generator.
  171. :Mandatory: No
  172. :Default: ``OFF``
  173. .. _nuget.org: https://www.nuget.org
  174. .. _version specification: https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges
  175. .. _SPDX license identifier: https://spdx.org/licenses
  176. .. _SPDX specification: https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions
  177. .. NuGet spec docs https://docs.microsoft.com/en-us/nuget/reference/nuspec