cpack.1.rst 4.2 KB

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