cpack.1.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.
  11. CMake projects use :command:`install` commands to define the contents of
  12. packages which can be generated in various formats by this tool.
  13. The :module:`CPack` module greatly simplifies the creation of the input file
  14. used by ``cpack``, allowing most aspects of the packaging configuration to be
  15. controlled directly from the CMake project's own ``CMakeLists.txt`` files.
  16. Options
  17. =======
  18. ``-G <generators>``
  19. ``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>`
  20. of generator names. ``cpack`` will iterate through this list and produce
  21. package(s) in that generator's format according to the details provided in
  22. the ``CPackConfig.cmake`` configuration file. A generator is responsible for
  23. generating the required inputs for a particular package system and invoking
  24. that system's package creation tools. Possible generator names are specified
  25. in the :manual:`Generators <cmake-generators(7)>` section of the manual and
  26. the ``--help`` option lists the generators supported for the target platform.
  27. If this option is not given, the :variable:`CPACK_GENERATOR` variable
  28. determines the default set of generators that will be used.
  29. ``-C <Configuration>``
  30. Specify the project configuration to be packaged (e.g. ``Debug``,
  31. ``Release``, etc.). When the CMake project uses a multi-configuration
  32. generator such as Xcode or Visual Studio, this option is needed to tell
  33. ``cpack`` which built executables to include in the package.
  34. ``-D <var>=<value>``
  35. Set a CPack variable. This will override any value set for ``<var>`` in the
  36. input file read by ``cpack``.
  37. ``--config <configFile>``
  38. Specify the configuration file read by ``cpack`` to provide the packaging
  39. details. By default, ``CPackConfig.cmake`` in the current directory will
  40. be used.
  41. ``--verbose,-V``
  42. Run ``cpack`` with verbose output. This can be used to show more details
  43. from the package generation tools and is suitable for project developers.
  44. ``--debug``
  45. Run ``cpack`` with debug output. This option is intended mainly for the
  46. developers of ``cpack`` itself and is not normally needed by project
  47. developers.
  48. ``--trace``
  49. Put the underlying cmake scripts in trace mode.
  50. ``--trace-expand``
  51. Put the underlying cmake scripts in expanded trace mode.
  52. ``-P <packageName>``
  53. Override/define the value of the :variable:`CPACK_PACKAGE_NAME` variable used
  54. for packaging. Any value set for this variable in the ``CPackConfig.cmake``
  55. file will then be ignored.
  56. ``-R <packageVersion>``
  57. Override/define the value of the :variable:`CPACK_PACKAGE_VERSION`
  58. variable used for packaging. It will override a value set in the
  59. ``CPackConfig.cmake`` file or one automatically computed from
  60. :variable:`CPACK_PACKAGE_VERSION_MAJOR`,
  61. :variable:`CPACK_PACKAGE_VERSION_MINOR` and
  62. :variable:`CPACK_PACKAGE_VERSION_PATCH`.
  63. ``-B <packageDirectory>``
  64. Override/define :variable:`CPACK_PACKAGE_DIRECTORY`, which controls the
  65. directory where CPack will perform its packaging work. The resultant
  66. package(s) will be created at this location by default and a
  67. ``_CPack_Packages`` subdirectory will also be created below this directory to
  68. use as a working area during package creation.
  69. ``--vendor <vendorName>``
  70. Override/define :variable:`CPACK_PACKAGE_VENDOR`.
  71. .. include:: OPTIONS_HELP.txt
  72. See Also
  73. ========
  74. .. include:: LINKS.txt