1
0

archive.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. CPack Archive Generator
  2. -----------------------
  3. CPack generator for packaging files into an archive, which can have
  4. any of the following formats:
  5. - 7Z - 7zip - (.7z)
  6. - TBZ2 (.tar.bz2)
  7. - TGZ (.tar.gz)
  8. - TXZ (.tar.xz)
  9. - TZ (.tar.Z)
  10. - TZST (.tar.zst)
  11. - ZIP (.zip)
  12. When this generator is called from ``CPackSourceConfig.cmake`` (or through
  13. the ``package_source`` target), then the generated archive will contain all
  14. files in the project directory, except those specified in
  15. :variable:`CPACK_SOURCE_IGNORE_FILES`. The following is one example of
  16. packaging all source files of a project:
  17. .. code-block:: cmake
  18. set(CPACK_SOURCE_GENERATOR "TGZ")
  19. set(CPACK_SOURCE_IGNORE_FILES
  20. \\.git/
  21. build/
  22. ".*~$"
  23. )
  24. set(CPACK_VERBATIM_VARIABLES YES)
  25. include(CPack)
  26. When this generator is called from ``CPackConfig.cmake`` (or through the
  27. ``package`` target), then the generated archive will contain all files
  28. that have been installed via CMake's :command:`install` command (and the
  29. deprecated commands :command:`install_files`, :command:`install_programs`,
  30. and :command:`install_targets`).
  31. Variables specific to CPack Archive generator
  32. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  33. .. variable:: CPACK_ARCHIVE_FILE_NAME
  34. CPACK_ARCHIVE_<component>_FILE_NAME
  35. Package file name without extension. The extension is determined from the
  36. archive format (see list above) and automatically appended to the file name.
  37. The default is ``<CPACK_PACKAGE_FILE_NAME>[-<component>]``, with spaces
  38. replaced by '-'.
  39. .. variable:: CPACK_ARCHIVE_COMPONENT_INSTALL
  40. Enable component packaging. If enabled (ON), then the archive generator
  41. creates multiple packages. The default is OFF, which means that a single
  42. package containing files of all components is generated.
  43. Variables used by CPack Archive generator
  44. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  45. These variables are used by the Archive generator, but are also available to
  46. CPack generators which are essentially archives at their core. These include:
  47. - :cpack_gen:`CPack Cygwin Generator`
  48. - :cpack_gen:`CPack FreeBSD Generator`
  49. .. variable:: CPACK_ARCHIVE_THREADS
  50. The number of threads to use when performing the compression. If set to
  51. ``0``, the number of available cores on the machine will be used instead.
  52. The default is ``1`` which limits compression to a single thread. Note that
  53. not all compression modes support threading in all environments. Currently,
  54. only the XZ compression may support it.
  55. .. note::
  56. Official CMake binaries available on ``cmake.org`` ship with a ``liblzma``
  57. that does not support parallel compression.