dmg.rst 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. CPack DragNDrop Generator
  2. -------------------------
  3. The DragNDrop CPack generator (macOS) creates a DMG image.
  4. Variables specific to CPack DragNDrop generator
  5. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  6. The following variables are specific to the DragNDrop installers built
  7. on macOS:
  8. .. variable:: CPACK_DMG_VOLUME_NAME
  9. The volume name of the generated disk image. Defaults to
  10. CPACK_PACKAGE_FILE_NAME.
  11. .. variable:: CPACK_DMG_FORMAT
  12. The disk image format. Common values are ``UDRO`` (UDIF read-only), ``UDZO`` (UDIF
  13. zlib-compressed) or ``UDBZ`` (UDIF bzip2-compressed). Refer to ``hdiutil(1)`` for
  14. more information on other available formats. Defaults to ``UDZO``.
  15. .. variable:: CPACK_DMG_DS_STORE
  16. Path to a custom ``.DS_Store`` file. This ``.DS_Store`` file can be used to
  17. specify the Finder window position/geometry and layout (such as hidden
  18. toolbars, placement of the icons etc.). This file has to be generated by
  19. the Finder (either manually or through AppleScript) using a normal folder
  20. from which the ``.DS_Store`` file can then be extracted.
  21. .. variable:: CPACK_DMG_DS_STORE_SETUP_SCRIPT
  22. .. versionadded:: 3.5
  23. Path to a custom AppleScript file. This AppleScript is used to generate
  24. a ``.DS_Store`` file which specifies the Finder window position/geometry and
  25. layout (such as hidden toolbars, placement of the icons etc.).
  26. By specifying a custom AppleScript there is no need to use
  27. ``CPACK_DMG_DS_STORE``, as the ``.DS_Store`` that is generated by the AppleScript
  28. will be packaged.
  29. .. variable:: CPACK_DMG_BACKGROUND_IMAGE
  30. Path to an image file to be used as the background. This file will be
  31. copied to ``.background``/``background.<ext>``, where ``<ext>`` is the original image file
  32. extension. The background image is installed into the image before
  33. ``CPACK_DMG_DS_STORE_SETUP_SCRIPT`` is executed or ``CPACK_DMG_DS_STORE`` is
  34. installed. By default no background image is set.
  35. .. variable:: CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK
  36. .. versionadded:: 3.6
  37. Default behavior is to include a symlink to ``/Applications`` in the DMG.
  38. Set this option to ``ON`` to avoid adding the symlink.
  39. .. variable:: CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE
  40. .. versionadded:: 3.23
  41. Control whether :variable:`CPACK_RESOURCE_FILE_LICENSE`, if set to a
  42. non-default value, is used as the license agreement provided when
  43. mounting the DMG. If ``CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE`` is
  44. not set, :manual:`cpack(1)` defaults to off.
  45. In a CMake project that uses the :module:`CPack` module to generate
  46. ``CPackConfig.cmake``, ``CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE``
  47. is automatically enabled by default if it is not set and
  48. :variable:`CPACK_RESOURCE_FILE_LICENSE` is set to a non-default value.
  49. .. note::
  50. This option was added in response to macOS 12.0's deprecation of
  51. the ``hdiutil udifrez`` command to make its use optional.
  52. CPack 3.22 and below always use :variable:`CPACK_RESOURCE_FILE_LICENSE`,
  53. if set to a non-default value, as the DMG license.
  54. .. variable:: CPACK_DMG_SLA_DIR
  55. .. versionadded:: 3.5
  56. Directory where license and menu files for different languages are stored.
  57. Setting this causes CPack to look for a ``<language>.menu.txt`` and
  58. ``<language>.license.txt`` or ``<language>.license.rtf`` file for every
  59. language defined in ``CPACK_DMG_SLA_LANGUAGES``. If both this variable and
  60. ``CPACK_RESOURCE_FILE_LICENSE`` are set, CPack will only look for the menu
  61. files and use the same license file for all languages. If both
  62. ``<language>.license.txt`` and ``<language>.license.rtf`` exist, the ``.txt``
  63. file will be used.
  64. .. versionadded:: 3.17
  65. RTF support.
  66. .. variable:: CPACK_DMG_SLA_LANGUAGES
  67. .. versionadded:: 3.5
  68. Languages for which a license agreement is provided when mounting the
  69. generated DMG. A menu file consists of 9 lines of text. The first line is
  70. is the name of the language itself, uppercase, in English (e.g. German).
  71. The other lines are translations of the following strings:
  72. - Agree
  73. - Disagree
  74. - Print
  75. - Save...
  76. - You agree to the terms of the License Agreement when you click the
  77. "Agree" button.
  78. - Software License Agreement
  79. - This text cannot be saved. The disk may be full or locked, or the file
  80. may be locked.
  81. - Unable to print. Make sure you have selected a printer.
  82. For every language in this list, CPack will try to find files
  83. ``<language>.menu.txt`` and ``<language>.license.txt`` in the directory
  84. specified by the :variable:`CPACK_DMG_SLA_DIR` variable.
  85. .. variable:: CPACK_DMG_<component>_FILE_NAME
  86. .. versionadded:: 3.17
  87. File name when packaging ``<component>`` as its own DMG
  88. (``CPACK_COMPONENTS_GROUPING`` set to IGNORE).
  89. - Default: ``CPACK_PACKAGE_FILE_NAME-<component>``
  90. .. variable:: CPACK_DMG_FILESYSTEM
  91. .. versionadded:: 3.21
  92. The filesystem format. Common values are ``APFS`` and ``HFS+``.
  93. See ``man hdiutil`` for a full list of supported formats.
  94. Defaults to ``HFS+``.
  95. .. variable:: CPACK_COMMAND_HDIUTIL
  96. Path to the ``hdiutil(1)`` command used to operate on disk image files on
  97. macOS. This variable can be used to override the automatically detected
  98. command (or specify its location if the auto-detection fails to find it).
  99. .. variable:: CPACK_COMMAND_SETFILE
  100. Path to the ``SetFile(1)`` command used to set extended attributes on files and
  101. directories on macOS. This variable can be used to override the
  102. automatically detected command (or specify its location if the
  103. auto-detection fails to find it).
  104. .. variable:: CPACK_COMMAND_REZ
  105. Path to the ``Rez(1)`` command used to compile resources on macOS. This
  106. variable can be used to override the automatically detected command (or
  107. specify its location if the auto-detection fails to find it).