cpack.1.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. .. cmake-manual-description: CPack Command-Line Reference
  2. cpack(1)
  3. ********
  4. Synopsis
  5. ========
  6. .. parsed-literal::
  7. cpack [<options>]
  8. Description
  9. ===========
  10. The :program:`cpack` executable is the CMake packaging program. It generates
  11. installers and source packages in a variety of formats.
  12. For each installer or package format, :program:`cpack` has a specific backend,
  13. called "generator". A generator is responsible for generating the required
  14. inputs and invoking the specific package creation tools. These installer
  15. or package generators are not to be confused with the makefile generators
  16. of the :manual:`cmake <cmake(1)>` command.
  17. All supported generators are specified in the :manual:`cpack-generators
  18. <cpack-generators(7)>` manual. The command ``cpack --help`` prints a
  19. list of generators supported for the target platform. Which of them are
  20. to be used can be selected through the :variable:`CPACK_GENERATOR` variable
  21. or through the command-line option :option:`-G <cpack -G>`.
  22. The :program:`cpack` program is steered by a configuration file written in the
  23. :manual:`CMake language <cmake-language(7)>`. Unless chosen differently
  24. through the command-line option :option:`--config <cpack --config>`, the
  25. file ``CPackConfig.cmake`` in the current directory is used.
  26. In the standard CMake workflow, the file ``CPackConfig.cmake`` is generated
  27. by the :manual:`cmake <cmake(1)>` executable, provided the :module:`CPack`
  28. module is included by the project's ``CMakeLists.txt`` file.
  29. Options
  30. =======
  31. .. program:: cpack
  32. .. option:: -G <generators>
  33. ``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>`
  34. of generator names. :program:`cpack` will iterate through this list and produce
  35. package(s) in that generator's format according to the details provided in
  36. the ``CPackConfig.cmake`` configuration file. If this option is not given,
  37. the :variable:`CPACK_GENERATOR` variable determines the default set of
  38. generators that will be used.
  39. .. option:: -C <configurations>
  40. Specify the project configuration(s) to be packaged (e.g. ``Debug``,
  41. ``Release``, etc.), where ``<configurations>`` is a
  42. :ref:`semicolon-separated list <CMake Language Lists>`.
  43. When the CMake project uses a multi-configuration
  44. generator such as :generator:`Xcode` or
  45. :ref:`Visual Studio <Visual Studio Generators>`, this option is needed to tell
  46. :program:`cpack` which built executables to include in the package.
  47. The user is responsible for ensuring that the configuration(s) listed
  48. have already been built before invoking :program:`cpack`.
  49. .. option:: -D <var>=<value>
  50. Set a CPack variable. This will override any value set for ``<var>`` in the
  51. input file read by :program:`cpack`.
  52. .. option:: --config <configFile>
  53. Specify the configuration file read by :program:`cpack` to provide the packaging
  54. details. By default, ``CPackConfig.cmake`` in the current directory will
  55. be used.
  56. .. option:: -V, --verbose
  57. Run :program:`cpack` with verbose output. This can be used to show more details
  58. from the package generation tools and is suitable for project developers.
  59. .. option:: --debug
  60. Run :program:`cpack` with debug output. This option is intended mainly for the
  61. developers of :program:`cpack` itself and is not normally needed by project
  62. developers.
  63. .. option:: --trace
  64. Put the underlying cmake scripts in trace mode.
  65. .. option:: --trace-expand
  66. Put the underlying cmake scripts in expanded trace mode.
  67. .. option:: -P <packageName>
  68. Override/define the value of the :variable:`CPACK_PACKAGE_NAME` variable used
  69. for packaging. Any value set for this variable in the ``CPackConfig.cmake``
  70. file will then be ignored.
  71. .. option:: -R <packageVersion>
  72. Override/define the value of the :variable:`CPACK_PACKAGE_VERSION`
  73. variable used for packaging. It will override a value set in the
  74. ``CPackConfig.cmake`` file or one automatically computed from
  75. :variable:`CPACK_PACKAGE_VERSION_MAJOR`,
  76. :variable:`CPACK_PACKAGE_VERSION_MINOR` and
  77. :variable:`CPACK_PACKAGE_VERSION_PATCH`.
  78. .. option:: -B <packageDirectory>
  79. Override/define :variable:`CPACK_PACKAGE_DIRECTORY`, which controls the
  80. directory where CPack will perform its packaging work. The resultant
  81. package(s) will be created at this location by default and a
  82. ``_CPack_Packages`` subdirectory will also be created below this directory to
  83. use as a working area during package creation.
  84. .. option:: --vendor <vendorName>
  85. Override/define :variable:`CPACK_PACKAGE_VENDOR`.
  86. .. option:: --preset <presetName>
  87. Use a preset from :manual:`cmake-presets(7)`.
  88. .. option:: --list-presets
  89. List presets from :manual:`cmake-presets(7)`.
  90. .. include:: include/OPTIONS_HELP.rst
  91. See Also
  92. ========
  93. .. include:: include/LINKS.rst