You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
4.0 KiB

  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 **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, **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 ``-G``.
  22. The **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 ``--config``, the file ``CPackConfig.cmake``
  25. 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. ``-G <generators>``
  32. ``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>`
  33. of generator names. ``cpack`` will iterate through this list and produce
  34. package(s) in that generator's format according to the details provided in
  35. the ``CPackConfig.cmake`` configuration file. If this option is not given,
  36. the :variable:`CPACK_GENERATOR` variable determines the default set of
  37. generators that will be used.
  38. ``-C <Configuration>``
  39. Specify the project configuration to be packaged (e.g. ``Debug``,
  40. ``Release``, etc.). When the CMake project uses a multi-configuration
  41. generator such as Xcode or Visual Studio, this option is needed to tell
  42. ``cpack`` which built executables to include in the package.
  43. ``-D <var>=<value>``
  44. Set a CPack variable. This will override any value set for ``<var>`` in the
  45. input file read by ``cpack``.
  46. ``--config <configFile>``
  47. Specify the configuration file read by ``cpack`` to provide the packaging
  48. details. By default, ``CPackConfig.cmake`` in the current directory will
  49. be used.
  50. ``--verbose,-V``
  51. Run ``cpack`` with verbose output. This can be used to show more details
  52. from the package generation tools and is suitable for project developers.
  53. ``--debug``
  54. Run ``cpack`` with debug output. This option is intended mainly for the
  55. developers of ``cpack`` itself and is not normally needed by project
  56. developers.
  57. ``--trace``
  58. Put the underlying cmake scripts in trace mode.
  59. ``--trace-expand``
  60. Put the underlying cmake scripts in expanded trace mode.
  61. ``-P <packageName>``
  62. Override/define the value of the :variable:`CPACK_PACKAGE_NAME` variable used
  63. for packaging. Any value set for this variable in the ``CPackConfig.cmake``
  64. file will then be ignored.
  65. ``-R <packageVersion>``
  66. Override/define the value of the :variable:`CPACK_PACKAGE_VERSION`
  67. variable used for packaging. It will override a value set in the
  68. ``CPackConfig.cmake`` file or one automatically computed from
  69. :variable:`CPACK_PACKAGE_VERSION_MAJOR`,
  70. :variable:`CPACK_PACKAGE_VERSION_MINOR` and
  71. :variable:`CPACK_PACKAGE_VERSION_PATCH`.
  72. ``-B <packageDirectory>``
  73. Override/define :variable:`CPACK_PACKAGE_DIRECTORY`, which controls the
  74. directory where CPack will perform its packaging work. The resultant
  75. package(s) will be created at this location by default and a
  76. ``_CPack_Packages`` subdirectory will also be created below this directory to
  77. use as a working area during package creation.
  78. ``--vendor <vendorName>``
  79. Override/define :variable:`CPACK_PACKAGE_VENDOR`.
  80. .. include:: OPTIONS_HELP.txt
  81. See Also
  82. ========
  83. .. include:: LINKS.txt