archive.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.