nuget.rst 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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 ``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. (``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 ``CPACK_XXX`` variables used by :module:`CPack`.
  15. The CPack NuGet generator has specific features which are controlled by the
  16. specifics ``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. - ``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. - ``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 : -
  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 : -
  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 ``CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME`` is specified,
  95. ``CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION`` is ignored.
  96. * Mandatory : NO
  97. * Default : -
  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 ``CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME`` is specified,
  102. ``CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION`` is ignored.
  103. .. versionadded:: 3.20
  104. * Mandatory : NO
  105. * Default : -
  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 : -
  114. .. variable:: CPACK_NUGET_PACKAGE_ICON
  115. CPACK_NUGET_<compName>_PACKAGE_ICON
  116. .. versionadded:: 3.20
  117. The filename of a 64x64 image with transparency background to use as the
  118. icon for the package in UI display.
  119. * Mandatory : NO
  120. * Default : -
  121. .. variable:: CPACK_NUGET_PACKAGE_DESCRIPTION_SUMMARY
  122. CPACK_NUGET_<compName>_PACKAGE_DESCRIPTION_SUMMARY
  123. A short description of the package for UI display. If omitted, a
  124. truncated version of description is used.
  125. * Mandatory : NO
  126. * Default : :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`
  127. .. variable:: CPACK_NUGET_PACKAGE_RELEASE_NOTES
  128. CPACK_NUGET_<compName>_PACKAGE_RELEASE_NOTES
  129. A description of the changes made in this release of the package,
  130. often used in UI like the Updates tab of the Visual Studio Package
  131. Manager in place of the package description.
  132. * Mandatory : NO
  133. * Default : -
  134. .. variable:: CPACK_NUGET_PACKAGE_COPYRIGHT
  135. CPACK_NUGET_<compName>_PACKAGE_COPYRIGHT
  136. Copyright details for the package.
  137. * Mandatory : NO
  138. * Default : -
  139. .. variable:: CPACK_NUGET_PACKAGE_LANGUAGE
  140. CPACK_NUGET_<compName>_PACKAGE_LANGUAGE
  141. .. versionadded:: 3.20
  142. Locale specifier for the package, for example ``en_CA``.
  143. * Mandatory : NO
  144. * Default : -
  145. .. variable:: CPACK_NUGET_PACKAGE_TAGS
  146. CPACK_NUGET_<compName>_PACKAGE_TAGS
  147. A space-delimited list of tags and keywords that describe the
  148. package and aid discoverability of packages through search and
  149. filtering.
  150. * Mandatory : NO
  151. * Default : -
  152. .. variable:: CPACK_NUGET_PACKAGE_DEPENDENCIES
  153. CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES
  154. A list of package dependencies.
  155. * Mandatory : NO
  156. * Default : -
  157. .. variable:: CPACK_NUGET_PACKAGE_DEPENDENCIES_<dependency>_VERSION
  158. CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<dependency>_VERSION
  159. A `version specification`_ for the particular dependency, where
  160. ``<dependency>`` is an item of the dependency list (see above)
  161. transformed with ``MAKE_C_IDENTIFIER`` function of :command:`string`
  162. command.
  163. * Mandatory : NO
  164. * Default : -
  165. .. variable:: CPACK_NUGET_PACKAGE_DEBUG
  166. Enable debug messages while executing CPack NuGet generator.
  167. * Mandatory : NO
  168. * Default : OFF
  169. .. _nuget.org: http://nuget.org
  170. .. _version specification: https://docs.microsoft.com/en-us/nuget/reference/package-versioning#version-ranges-and-wildcards
  171. .. _(SPDX) license identifier: https://spdx.org/licenses/
  172. .. _SPDX specification: https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/
  173. .. NuGet spec docs https://docs.microsoft.com/en-us/nuget/reference/nuspec