CPACK-GENERATORS(7)
๐ธ CPack Generators, bestie ๐ธ
Okay so this is the cpack-generators page โ the CPack Generator Reference ๐
like, the whole master list of every generator CPack can ship your stuff with. Grab a strawberry drink ๐, we're going through it together, and yes we're keeping every single detail because that's just how I roll.
โจ GENERATORS โจ
๐ CPack AppImage Generator
Added in version 4.2.
So the CPack AppImage generator (over at <https://appimage.org>, iykyk) lets you bundle your whole app into the AppImage format. It uses appimagetool to pack everything up, and patchelf to set your app's RPATH to a relative path โ and that path is based on where the AppImage is gonna get mounted. Clever, right? ๐ง
Real talk though: appimagetool does not scan for library dependencies. It literally only packs the installed content and checks whether the .desktop file you gave it was properly created. That's it. For best compatibility, it's recommended that you build on an old LTS distribution and include any dependencies in the generated file. ๐ซถ
The snippet below can be added to your CMakeLists.txt. Just swap my_application_target for your actual application target. This example does a best effort to identify the libraries your application links to and copy them to the install location:
install(CODE [[
file(GET_RUNTIME_DEPENDENCIES
EXECUTABLES $<TARGET_FILE:my_application_target>
RESOLVED_DEPENDENCIES_VAR resolved_deps
)
foreach(dep ${resolved_deps})
# copy the symlink
file(COPY ${dep} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
# Resolve the real path of the dependency (follows symlinks)
file(REAL_PATH ${dep} resolved_dep_path)
# Copy the resolved file to the destination
file(COPY ${resolved_dep_path} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
endforeach()
]])
The CPack AppImage generator will generate a default AppRun (check <https://docs.appimage.org/introduction/software-overview.html#apprun>) based on the .desktop entry you provide. OR โ plot twist โ if a custom AppRun is installed, like via the install() command, then that one gets used instead of the generated one. Main character energy from your custom file, honestly. ๐
For Qt-based projects: it is recommended to call qt_generate_deploy_app_script() or qt_generate_deploy_qml_app_script() and install the files generated by the script. That's what installs the Qt plugins. โจ
You must also set CPACK_PACKAGE_ICON with the same value listed in the Desktop file. No cap, it has to match.
๐ฆ Variables Specific to CPack AppImage Generator
CPACK_APPIMAGE_TOOL_EXECUTABLEโ Name of theappimagetoolexecutable. If you don't give it as an absolute path, logic based onfind_program()will be used internally with this value to find the executable.- Default:
appimagetool
- Default:
CPACK_APPIMAGE_PATCHELF_EXECUTABLEโ Name of thepatchelfexecutable. If you don't give it as an absolute path, logic based onfind_program()will be used internally with this value to find the executable.- Default:
patchelf
- Default:
CPACK_APPIMAGE_DESKTOP_FILEโ Name of the freedesktop.org desktop file to be installed. If not specified, the first.desktopfile found in the list of files to be installed will be used. There must be a valid.desktopfile for the package, and it must include anIconentry that matchesCPACK_PACKAGE_ICONwithout the file extension. The actual installed location of the icon should follow the freedesktop.org specification.- Default: Unset
CPACK_APPIMAGE_UPDATE_INFORMATIONโ Embed the value of this variable as the update information. See theappimagetoolsource code for the supported values and formats of the--updateinformationoption. It is highly recommended to have thezsyncmaketool installed if usingzsyncupdate information.- Default: Unset
CPACK_APPIMAGE_GUESS_UPDATE_INFORMATIONโ When this variable is true, add the--guessoption to theappimagetoolinvocation. This directs the tool to try to guess appropriate update information based on GitHub or GitLab environment variables.- Default: Unset
CPACK_APPIMAGE_COMPRESSORโ Override theappimagetool's default type of squashfs compression (zstd). This corresponds to theappimagetool--compoption.- Default: Unset
CPACK_APPIMAGE_MKSQUASHFS_OPTIONSโ List of arguments to pass through tomksquashfs. Each of these will be preceded by--mksquashfs-opton theappimagetoolcommand line.- Default: Unset
CPACK_APPIMAGE_NO_APPSTREAMโ If set to true, do not check AppStream metadata. This passes the--no-appstreamoption toappimagetool.- Default: Unset
CPACK_APPIMAGE_EXCLUDE_FILEโ Use the specified file as an exclude file formksquashfs, in addition to.appimageignore. This uses the--exclude-fileoption toappimagetool.- Default: Unset
CPACK_APPIMAGE_RUNTIME_FILEโ Specify a runtime file to use instead of letting theappimagetooldownload a runtime to embed in the generated AppImage.- Default: Unset
CPACK_APPIMAGE_SIGNโ When set to true, sign the generated AppImage withgpg[2].CPACK_APPIMAGE_SIGN_KEYshould also be specified if using this option.- Default: Unset
CPACK_APPIMAGE_SIGN_KEYโ Key ID to use forgpg[2]signatures when signing is enabled withCPACK_APPIMAGE_SIGN.- Default: Unset
๐ CPack Archive Generator
CPack generator for packaging files into an archive โ and the archive can have any of these formats. Buckle up bestie, it's a long list but every one of them ate:
7Zโ 7zip - (.7z) - LZMA compressed- Added in version 3.1.
- This is an alias for
7Z_LZMA
7Z_BZ2โ 7zip - (.7z) - BZip2 compressed- Added in version 4.3.
7Z_DEFLATEโ 7zip - (.7z) - Deflate compressed- Added in version 4.3.
7Z_LZMAโ 7zip - (.7z) - LZMA compressed- Added in version 4.3.
7Z_LZMA2โ 7zip - (.7z) - LZMA2 compressed- Added in version 4.3.
7Z_PPMDโ 7zip - (.7z) - PPMd compressed- Added in version 4.3.
7Z_STOREโ 7zip - (.7z) - no compression is used- Added in version 4.3.
7Z_ZSTDโ 7zip - (.7z) - Zstandard compressed- Added in version 4.3.
TAR(.tar) - no compression is used- Added in version 4.0.
TBZ2(.tar.bz2) - BZip2 compressedTGZ(.tar.gz) - Deflate compressedTXZ(.tar.xz) - LZMA2 compressed- Added in version 3.1.
TZ(.tar.Z) - LZW compressedTZST(.tar.zst) - Zstandard compressed- Added in version 3.16.
ZIP(.zip) - Deflate compressed- This is an alias for
ZIP_DEFLATE
- This is an alias for
ZIP_BZ2(.zip) - BZip2 compressed- Added in version 4.3.
ZIP_DEFLATE(.zip) - Deflate compressed- Added in version 4.3.
ZIP_LZMA(.zip) - LZMA compressed- Added in version 4.3.
ZIP_LZMA2(.zip) - LZMA2 compressed- Added in version 4.3.
ZIP_STORE(.zip) - no compression is used- Added in version 4.3.
ZIP_ZSTD(.zip) - Zstandard compressed- Added in version 4.3.
Okay so when this generator is called from CPackSourceConfig.cmake (or through the package_source target), the generated archive will contain all files in the project directory, except those specified in CPACK_SOURCE_IGNORE_FILES. Here's one example of packaging all source files of a project:
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES
\\.git/
build/
".*~$"
)
set(CPACK_VERBATIM_VARIABLES YES)
include(CPack)
And when this generator is called from CPackConfig.cmake (or through the package target), then the generated archive will contain all files that have been installed via CMake's install() command (plus the deprecated commands install_files(), install_programs(), and install_targets()). ๐
๐ธ Variables specific to CPack Archive generator
CPACK_ARCHIVE_FILE_NAME- Added in version 3.9.
- Archive name for component-based packages, without extension.
- Default:
CPACK_PACKAGE_FILE_NAME - The extension is appended automatically.
- If
CPACK_COMPONENTS_GROUPINGis set toALL_COMPONENTS_IN_ONE, this will be the name of the one output archive. - Changed in version 4.0: this variable also works for non-component packages.
CPACK_ARCHIVE_<component>_FILE_NAME- Added in version 3.9.
- Component archive name without extension.
- Default:
<CPACK_ARCHIVE_FILE_NAME>-<component>, with spaces replaced by-. - The extension is appended automatically. Note that
<component>is all uppercase in the variable name. Don't forget, bestie ๐ซถ
CPACK_ARCHIVE_FILE_EXTENSION- Added in version 3.25.
- Archive file extension.
- Default: default values are given in the list above.
CPACK_ARCHIVE_COMPONENT_INSTALL- Enable component packaging.
- Default:
OFF - If enabled (
ON) multiple packages are generated. By default a single package containing files of all components is generated.
CPACK_ARCHIVE_UID- Set the UID of entries contained in the archive. Specify
-1to use the UID of the current user. - Default:
0(see policyCMP0206)
- Set the UID of entries contained in the archive. Specify
CPACK_ARCHIVE_GID- Set the GID of entries contained in the archive. Specify
-1to use the GID of the current user. - Default:
0(see policyCMP0206)
- Set the GID of entries contained in the archive. Specify
๐ Variables used by CPack Archive generator
These variables are used by the Archive generator, but they're also available to CPack generators which are essentially archives at their core. Those include:
- CPack Cygwin Generator
- CPack FreeBSD Generator
CPACK_ARCHIVE_THREADS- Added in version 3.18.
- The number of threads to use when performing the compression.
- Default: value of
CPACK_THREADS - If set to
0, the number of available cores on the machine will be used instead. Note that not all compression modes support threading in all environments. ๐ so like, don't assume, okay?
Also, real quick โ Added in version 3.21: the official CMake binaries you grab from cmake.org now ship with a liblzma that actually supports parallel compression. Older versions? Did not. ๐
CPACK_ARCHIVE_COMPRESSION_LEVEL
Added in version 4.3.
The compression level to use when compressing the archive ๐๏ธโจ
- Default: the value of
CPACK_COMPRESSION_LEVEL
So like, the compression level should sit between 0 and 9.
For the Zstandard-based algorithm you can set it between 0 and 19 โ except for the ZIP_ZSTD mode, which is not invited to that party ๐.
The value 0 means "use the default compression level." That default gets picked automatically by the archive library backend and is not directly set by CMake itself, so it can vary between archive formats, platforms, etc. Basically it's giving "whatever the backend feels like" energy.
CPACK_ARCHIVE_ENCODING
Added in version 4.4.
Specifies the pathname character encoding used in package archives ๐ค๐
- Default:
UTF-8
Wanna know which encoding names are supported? Go peek at the cmake -E tar tool's --cmake-tar-encoding flag โ that's the whole list, bestie.
In CMake 4.3 and below, the OEM encoding (current locale) was always used. No choices, no vibes, just locale. ๐ญ
๐ CPack Bundle Generator
CPack Bundle generator (macOS) specific options โ yes, we're in Apple territory now ๐
Variables specific to CPack Bundle generator
Installers built on macOS with the Bundle generator use all the DragNDrop stuff we already covered (the CPACK_DMG_xxx variables) plus these Bundle-specific parameters, aka the CPACK_BUNDLE_xxx crew ๐ซถ
CPACK_BUNDLE_NAME
The name of the generated bundle. This is the name that shows up in the macOS Finder as the bundle name. Required.
CPACK_BUNDLE_PLIST
Path to a macOS Property List (.plist) file that'll be used for the generated bundle. This assumes the caller has already generated or specified their own Info.plist file โ so like, do your homework first ๐. Required.
CPACK_BUNDLE_ICON
Path to a macOS icon file that'll be used as the icon for the generated bundle. This is the icon that appears in the macOS Finder for the bundle, and in the macOS dock when the bundle is opened. Main character icon energy ๐ Required.
CPACK_BUNDLE_STARTUP_COMMAND
Path to a startup script. This is a path to an executable or script that gets run whenever an end-user double-clicks the generated bundle in the macOS Finder. Optional.
CPACK_BUNDLE_APPLE_CERT_APP
Added in version 3.2.
The name of your Apple-supplied code signing certificate for the application. The name usually takes the form Developer ID Application: [Name] or 3rd Party Mac Developer Application: [Name]. If this variable is not set, the application will not be signed. Periodt. ๐
CPACK_BUNDLE_APPLE_ENTITLEMENTS
Added in version 3.2.
The name of the Property List (.plist) file that contains your Apple entitlements for sandboxing your application. This file is required for submission to the macOS App Store โ no entitlements, no App Store, sorry bestie ๐ฅฒ
CPACK_BUNDLE_APPLE_CODESIGN_FILES
Added in version 3.2.
A list of additional files that you want signed. You do not need to list the main application folder or the main executable โ they're already handled. You should list any frameworks and plugins that are included in your app bundle ๐
CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER
Added in version 3.3.
Additional parameter that will be passed to codesign.
- Default value:
--deep -f
CPACK_COMMAND_CODESIGN
Added in version 3.2.
Path to the codesign(1) command used to sign applications with an Apple cert. This variable lets you override the automatically detected command, or specify its location if the auto-detection fails to find it ๐
๐ธ CPack Cygwin Generator
Cygwin CPack generator (Cygwin).
Variables affecting the CPack Cygwin generator
- Added in version 3.18:
CPACK_ARCHIVE_THREADS
Variables specific to CPack Cygwin generator
The following variable is specific to installers built on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER
The Cygwin patch number. FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE
The Cygwin patch file. FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT
The Cygwin build script. FIXME: This documentation is incomplete.
(Yeah, all three of those are literally flagged incomplete in the source. I'm not making it up, I promise ๐)
๐ฅ CPack DEB Generator
The built-in (binary) CPack DEB generator (Unix only).
Variables specific to CPack Debian (DEB) generator
The CPack DEB generator can be used to create a DEB package using CPack. It is a CPack generator, so it uses the CPACK_XXX variables that CPack uses. Same family, same rules ๐
The CPack DEB generator should work on any Linux host, but it'll produce a better deb package when the Debian-specific tools dpkg-xxx are usable on the build system. Like, it works either way, but it slays when dpkg is around โจ
The CPack DEB generator has specific features which are controlled by the specific CPACK_DEBIAN_XXX variables.
CPACK_DEBIAN_<COMPONENT>_XXXX variables can be used to get component-specific values. But heads up: <COMPONENT> refers to the grouping name written in upper case. It can be either a component name or a component GROUP name ๐ซถ
Here are some CPack DEB generator wiki resources that are hanging around for historic reasons โ they're no longer maintained, but they may still prove useful:
https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configurationhttps://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#deb-unix-only
List of CPack DEB generator specific variables โ buckle up, there's a lot ๐
CPACK_DEB_COMPONENT_INSTALL
Enables component packaging for CPackDEB.
- Mandatory: No
- Default:
OFF
If enabled (ON), multiple packages get generated. By default, a single package containing the files of all components is generated ๐
CPACK_DEBIAN_PACKAGE_NAME / CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME
Set the Package control field (the variable is automatically transformed to lower case, no cap).
- Mandatory: Yes
- Default:
CPACK_PACKAGE_NAMEfor non-component based installationsCPACK_DEBIAN_PACKAGE_NAMEsuffixed with-<COMPONENT>for component-based installations
Added in version 3.5: Per-component CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME variables.
See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source
CPACK_DEBIAN_FILE_NAME / CPACK_DEBIAN_<COMPONENT>_FILE_NAME
Added in version 3.6.
Package file name.
- Mandatory: Yes
- Default:
<CPACK_PACKAGE_FILE_NAME>[-<component>].deb
This may be set to:
DEB-DEFAULTโ tells CPack to automatically generate the package file name in deb format:
<PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
This setting is recommended as the preferred behavior, but for backward compatibility with the CPack DEB generator in CMake prior to version 3.6, it's not the default. Without this, duplicate names may occur. Duplicate files get overwritten and it's up to the packager to set the variables in a way that prevents those errors ๐ฌ
<file-name>[.deb]โ use the given file name.
Changed in version 3.29: The .deb suffix is automatically added if the file name doesn't end in .deb or .ipk. Previously the suffix was required. Glow-up fr fr โจ
<file-name>.ipkโ Added in version 3.10. Use the given file name. The.ipksuffix is what the OPKG packaging system uses.
CPACK_DEBIAN_PACKAGE_EPOCH
Added in version 3.10.
The Debian package epoch.
- Mandatory: No
- Default: None
Optional number that should be incremented when you change versioning schemas or fix mistakes in the version numbers of older packages ๐ข
CPACK_DEBIAN_PACKAGE_VERSION
The Debian package version.
- Mandatory: Yes
- Default:
CPACK_PACKAGE_VERSION
This variable may contain only alphanumerics (A-Za-z0-9) and the characters . + - ~ (full stop, plus, hyphen, tilde) and it should start with a digit. If CPACK_DEBIAN_PACKAGE_RELEASE is not set, then hyphens are not allowed ๐ซ
Note: for backward compatibility with CMake 3.9 and lower, a failed test of this variable's content is not a hard error when both theCPACK_DEBIAN_PACKAGE_RELEASEandCPACK_DEBIAN_PACKAGE_EPOCHvariables are not set. An author warning is reported instead. So like, it yells at you but doesn't actually stop you ๐ญ
CPACK_DEBIAN_PACKAGE_RELEASE
Added in version 3.6.
The Debian package release โ the Debian revision number.
- Mandatory: No
- Default: None
This is the numbering of the DEB package itself, i.e. the version of the packaging, not the version of the content (that one's CPACK_DEBIAN_PACKAGE_VERSION, don't mix them up bestie ๐
). You can change the default value if the previous packaging was buggy and/or you want to put a fancy Linux-distro-specific numbering here.
CPACK_DEBIAN_PACKAGE_ARCHITECTURE / CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE
The Debian package architecture.
- Mandatory: Yes
- Default: output of
dpkg --print-architecture(ori386ifdpkgis not found)
Added in version 3.6: Per-component CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE variables.
CPACK_DEBIAN_PACKAGE_DEPENDS / CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS
Sets the Debian dependencies of this package ๐งฒ
- Mandatory: No
- Default:
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_DEPENDSfor component-based installations
Added in version 3.3: Per-component CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS variables.
Note: ifCPACK_DEBIAN_PACKAGE_SHLIBDEPSโ or, more specifically,CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPSโ is set for this component, then the deps it discovers get appended toCPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS, not toCPACK_DEBIAN_PACKAGE_DEPENDS. And ifCPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDSis an empty string, then literally only the automatically discovered deps get set for that component. iykyk ๐
Changed in version 3.31: the variable is always expanded as a list now. Before, it only got expanded if you were using it together with CPACK_DEB_COMPONENT_INSTALL, CPACK_DEBIAN_PACKAGE_SHLIBDEPS or CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS. Which meant that if a component had no shared libraries discovered (like, say, a package made entirely of scripts ๐) you had to join the list yourself just to get a valid Depends field. annoying, honestly.
Example:
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
list(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS cmake)
๐ธ CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS
Added in version 3.6.
Sets inter-component dependencies โ but only if you listed them with the CPACK_COMPONENT_<compName>_DEPENDS variables. so it's a whole "you have to opt in" situation ๐ซถ
Mandatory โ No
Default โ None
๐ CPACK_DEBIAN_PACKAGE_MAINTAINER
The Debian package maintainer. yes, someone has to take the credit (and the bug reports ๐ญ).
Mandatory โ Yes
Default โ CPACK_PACKAGE_CONTACT
๐ฆ CPACK_DEBIAN_PACKAGE_DESCRIPTION
๐ฆ CPACK_DEBIAN_<COMPONENT>_DESCRIPTION
The Debian package description. the little blurb that sells your package, bestie โจ
Mandatory โ Yes
Default โ in this exact order, first one that hits:
CPACK_DEBIAN_<COMPONENT>_DESCRIPTION(component based installers only) if set, orCPACK_DEBIAN_PACKAGE_DESCRIPTIONif set, orCPACK_COMPONENT_<compName>_DESCRIPTION(component based installers only) if set, orCPACK_PACKAGE_DESCRIPTIONif set, or- the content of the file specified in
CPACK_PACKAGE_DESCRIPTION_FILEif set
And if after all that the description is still not set, then CPACK_PACKAGE_DESCRIPTION_SUMMARY is going to be used if it's set. Otherwise? CPACK_PACKAGE_DESCRIPTION_SUMMARY gets added as the first line of the description, as defined in the Debian Policy Manual (https://www.debian.org/doc/debian-policy/ch-controlfields.html#description).
Added in version 3.3: per-component CPACK_COMPONENT_<compName>_DESCRIPTION variables.
Added in version 3.16: per-component CPACK_DEBIAN_<COMPONENT>_DESCRIPTION variables.
Added in version 3.16: the CPACK_PACKAGE_DESCRIPTION_FILE variable.
๐ CPACK_DEBIAN_PACKAGE_SECTION
๐ CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
Sets the Section control field, e.g. admin, devel, doc, ... you know, the classic categories ๐๏ธ
Mandatory โ Yes
Default โ devel
Added in version 3.5: per-component CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION variables.
See https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
โญ CPACK_DEBIAN_ARCHIVE_TYPE
Added in version 3.7.
Deprecated since version 3.14.
The archive format used for creating the Debian package.
Mandatory โ Yes
Default โ gnutar
Possible value is: gnutar โ that's it, that's the whole list ๐ฏ
Note: this variable used to default to thepaxrvalue, but dpkg has never supported that tar format. for backwards compatibility thepaxrvalue gets mapped tognutarand a deprecation message gets emitted. so like, it works, but it's gonna side-eye you about it ๐
๐ฅ CPACK_DEBIAN_COMPRESSION_TYPE
Added in version 3.1.
The compression used for creating the Debian package.
Mandatory โ Yes
Default โ gzip
Possible values are, and yes I'm listing every single one ๐
lzmaโ Lempel-Ziv-Markov chain algorithmxzโ XZ Utils LZMA2 (Lempel-Ziv-Markov chain algorithm, version 2) compressionbzip2โ bzip2 Burrows-Wheeler algorithmgzipโ GNU Gzip Deflate compressionzstdโ Added in version 3.22. Zstandard compression
๐ง CPACK_DEBIAN_COMPRESSION_LEVEL
Added in version 4.3.
The compression level used for creating the Debian package. the fine-tuning knob, the "how hard should we squeeze this" dial ๐๏ธ
Mandatory โ No
Default โ the value of CPACK_COMPRESSION_LEVEL
This variable lets you fine-tune the compression ratio and the speed for the Debian package archive. It controls the numeric compression level passed to the compressor defined by CPACK_DEBIAN_COMPRESSION_TYPE. If CPACK_DEBIAN_COMPRESSION_LEVEL is not set, or is set to 0, the default value gets used. simple as that โจ
The valid range and how it's interpreted depend on the compression type you picked:
gzipโ level 1-9bzip2โ level 1-9xzโ level 1-9lzmaโ level 1-9zstdโ level 1-19
Example usage:
set(CPACK_DEBIAN_COMPRESSION_TYPE "xz")
set(CPACK_DEBIAN_COMPRESSION_LEVEL 9)
include(CPack)
๐ CPACK_DEBIAN_PACKAGE_PRIORITY
๐ CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY
Sets the Priority control field, e.g. required, important, standard, optional, extra. it's giving "how much does your system need this" energy ๐
Mandatory โ Yes
Default โ optional
Added in version 3.5: per-component CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY variables.
See https://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities
๐ธ CPACK_DEBIAN_PACKAGE_HOMEPAGE
The URL of the web site for this package โ preferably (when applicable) the site from which the original source can be obtained, plus any additional upstream documentation or info that might live there. basically: where do people go to learn more about your masterpiece ๐
Mandatory โ No
Default โ CMAKE_PROJECT_HOMEPAGE_URL
Added in version 3.12: the CMAKE_PROJECT_HOMEPAGE_URL variable.
Note: the content of this field is a plain simple URL with no surrounding characters like <>. no angle brackets, no cute decorations, just the URL. periodt ๐
๐ฆ CPACK_DEBIAN_PACKAGE_SHLIBDEPS
๐ฆ CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS
May be set to ON in order to use dpkg-shlibdeps to generate a better package dependency list. like, actual real deps, discovered for you ๐โจ
Mandatory โ No
Default โ
CPACK_DEBIAN_PACKAGE_SHLIBDEPSif set, orOFF
Note: you may need to setCMAKE_INSTALL_RPATHto an appropriate value if you use this feature, because if you don't,dpkg-shlibdepsmay fail to find your own shared libs. no cap, it will just give up ๐ญ See https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
Note: you can also setCPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRSto an appropriate value if you use this feature, in order to pleasedpkg-shlibdeps. however โ and this is important โ you should only do this for private shared libraries that could not get resolved otherwise. don't be out here spoiling it ๐
Added in version 3.3: per-component CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS variables.
Added in version 3.6: correct handling of $ORIGIN in CMAKE_INSTALL_RPATH.
๐ CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS
Added in version 3.20.
May be set to a list of directories that will be given to dpkg-shlibdeps via its -l option. these get searched by dpkg-shlibdeps in order to find private shared library dependencies ๐ต๏ธโโ๏ธ
Mandatory โ No
Default โ None
Note: you should prefer to setCMAKE_INSTALL_RPATHto an appropriate value if you usedpkg-shlibdeps. The current option is really only needed for private shared library dependencies. like, it's the last resort, not the main character ๐
</br>
๐ซถ CPACK_DEBIAN_PACKAGE_DEBUG
May be set when invoking cpack in order to trace debug information during the CPack DEB generator run. the "please tell me what's happening" switch ๐
Mandatory โ No
Default โ None
โญ CPACK_DEBIAN_PACKAGE_PREDEPENDS
โญ CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS
Sets the Pre-Depends field of the Debian package. it's like Depends, except it also forces dpkg to complete installation of the packages named before even starting the installation of the package which declares the pre-dependency. so like, ultra-depends. it goes first, no skipping the line ๐จ
Mandatory โ No
Default โ
- an empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_PREDEPENDSfor component-based installations.
Added in version 3.4: per-component CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS variables.
See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
๐ CPACK_DEBIAN_PACKAGE_ENHANCES
๐ CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES
Sets the Enhances field of the Debian package. Similar to Suggests but it works in the opposite direction: it declares that a package can enhance the functionality of another package. so it's not "I need you", it's "you'd be even better with me in the picture" ๐
Mandatory โ No
Default โ
- an empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_ENHANCESfor component-based installations.
Added in version 3.4: per-component CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES variables.
See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
๐
CPACK_DEBIAN_PACKAGE_BREAKS
(to be continuedโฆ)
CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKSโ sets theBreaksfield of the Debian package. Bestie, here's the tea โ: when a binary package (P) declares that it breaks other packages (B),dpkgwill not allow the package (P) which declaresBreaksto be unpacked unless the packages that will be broken (B) are deconfigured first. And as long as package (P) is configured, those previously deconfigured packages (B) cannot be reconfigured again. it's giving "you can't sit with us" energy ๐- Mandatory โ No
- Default
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_BREAKSfor component-based installations.
- Added in version 3.4 โ per-component
CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKSvariables. slay โจ - See โ
https://www.debian.org/doc/debian-policy/ch-relationships.html#s-breaks
CPACK_DEBIAN_PACKAGE_CONFLICTSCPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTSโ sets theConflictsfield of the Debian package. When one binary package declares a conflict with another using aConflictsfield,dpkgwill not allow them to be unpacked on the system at the same time. literally cannot coexist, it's giving oil and water ๐ซ- Mandatory โ No
- Default
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_CONFLICTSfor component-based installations.
- Added in version 3.4 โ per-component
CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTSvariables. - See โ
https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts - Note โ this is a stronger restriction than
Breaks, which prevents the broken package from being configured while the breaking package is in the"Unpacked"state but allows both packages to be unpacked at the same time. so like,Breaksis "you're on pause",Conflictsis "we're never in the same room". periodt ๐
CPACK_DEBIAN_PACKAGE_PROVIDESCPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDESโ sets theProvidesfield of the Debian package. A virtual package is one which appears in theProvidescontrol field of another package. main character energy: existing in theProvidesfield of someone else's whole narrative ๐- Mandatory โ No
- Default
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_PROVIDESfor component-based installations.
- Added in version 3.4 โ per-component
CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDESvariables. - See โ
https://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual
CPACK_DEBIAN_PACKAGE_REPLACESCPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACESโ sets theReplacesfield of the Debian package. Packages can declare in their control file that they should overwrite files in certain other packages, or completely replace other packages. not just showing up, but taking the whole closet ๐- Mandatory โ No
- Default
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_REPLACESfor component-based installations.
- Added in version 3.4 โ per-component
CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACESvariables. - See โ
https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
CPACK_DEBIAN_PACKAGE_RECOMMENDSCPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDSโ sets theRecommendsfield of the Debian package. Allows packages to declare a strong, but not absolute, dependency on other packages. like a "you should really come to this party" invite ๐- Mandatory โ No
- Default
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_RECOMMENDSfor component-based installations.
- Added in version 3.4 โ per-component
CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDSvariables. - See โ
https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
CPACK_DEBIAN_PACKAGE_SUGGESTSCPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTSโ sets theSuggestsfield of the Debian package. Allows packages to declare a suggested package install grouping. the softest of soft launches, ngl ๐ธ- Mandatory โ No
- Default
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_SUGGESTSfor component-based installations.
- Added in version 3.4 โ per-component
CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTSvariables. - See โ
https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBSโ added in version 3.6 โจ- Mandatory โ No
- Default โ
OFF - Allows to generate
shlibscontrol file automatically. Compatibility is defined by theCPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICYvariable value. - Note โ libraries are only considered if they have both library name and version set. This can be done by setting
SOVERSIONproperty with theset_target_properties()command. no version, no entry, iykyk ๐ง
CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICYโ added in version 3.6- Compatibility policy for auto-generated
shlibscontrol file. - Mandatory โ No
- Default โ
= - Defines compatibility policy for auto-generated
shlibscontrol file. Possible values:=,>= - See โ
https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-sharedlibs-shlibdeps
- Compatibility policy for auto-generated
CPACK_DEBIAN_PACKAGE_CONTROL_EXTRACPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_EXTRAโ this variable allows advanced users to add a custom script to thecontrol.tar.gz. Typical usage is forconffiles,postinst,postrm,prerm. the DIY era of your packaging journey ๐ ๏ธ- Mandatory โ No
- Default โ None
- Usage:
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR}/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
- Added in version 3.4 โ per-component
CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_EXTRAvariables.
CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSIONCPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_STRICT_PERMISSIONโ added in version 3.4- This variable indicates if the Debian policy on control files should be strictly followed.
- Mandatory โ No
- Default โ
FALSE - Usage:
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
- This overrides the permissions on the original files, following the rules set by Debian policy:
https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners - Note โ the original permissions of the files will be used in the final package unless this variable is set to
TRUE. In particular, the scripts should have the proper executable flag prior to the generation of the package. so like, chmod before you ship, bestie ๐
CPACK_DEBIAN_PACKAGE_SOURCECPACK_DEBIAN_<COMPONENT>_PACKAGE_SOURCEโ added in version 3.5- Sets the
Sourcefield of the binary Debian package. When the binary package name is not the same as the source package name (in particular when several components/binaries are generated from one source) the source from which the binary has been generated should be indicated with the fieldSource. it's giving "yes i have a parent, here's their name" ๐ - Mandatory โ No
- Default
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_SOURCEfor component-based installations.
- See โ
https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source - Note โ this value is not interpreted. It is possible to pass an optional revision number of the referenced source package as well.
- Sets the
CPACK_DEBIAN_PACKAGE_MULTIARCHCPACK_DEBIAN_<COMPONENT>_PACKAGE_MULTIARCHโ sets theMulti-Archfield of the Debian package. Packages can declare in their control file how they should handle situations where packages for different architectures are being installed on the same machine. coexist gracefully, we love to see it ๐ฆ- Mandatory โ No
- Default
- An empty string for non-component based installations
CPACK_DEBIAN_PACKAGE_MULTIARCHfor component-based installations.
- Added in version 3.31 โ per-component
CPACK_DEBIAN_<COMPONENT>_PACKAGE_MULTIARCHvariables. - See โ
https://wiki.debian.org/MultiArch/Hints - Note โ this value is validated. It must be one of the following values:
same,foreign,allowed. no custom vibes allowed here โญ
๐ Packaging of debug information ๐
Added in version 3.13.
Dbgsym packages contain debug symbols for debugging packaged binaries.
Dbgsym packaging has its own set of variables:
CPACK_DEBIAN_DEBUGINFO_PACKAGECPACK_DEBIAN_<component>_DEBUGINFO_PACKAGEโ enable generation of dbgsym.ddebpackage(s). โจ- Mandatory โ No
- Default โ
OFF
Note โ setting this also strips the ELF files in the generated non-dbgsym package, which results in debuginfo only being available in the dbgsym package. so the debug info ships in exactly one place, no duplicates ๐
Note โ binaries must contain debug symbols before packaging, so use eitherDebugorRelWithDebInfofor theCMAKE_BUILD_TYPEvariable value. Additionally, ifCPACK_STRIP_FILESis set, the files will be stripped before they get to the DEB generator, so will not contain debug symbols and a dbgsym package will not get built. Do not use withCPACK_STRIP_FILES. for real, don't do it ๐ญ
๐ช Building Debian packages on Windows ๐ช
Added in version 3.10.
To communicate UNIX file permissions from the install stage to the CPack DEB generator, the cmake_mode_t NTFS alternate data stream (ADT) is used.
When a filesystem without ADT support is used, only owner read/write permissions can be preserved. that's the whole deal, ngl ๐
๐ฐ๏ธ Reproducible packages ๐ฐ๏ธ
Added in version 3.13.
The environment variable SOURCE_DATE_EPOCH may be set to a UNIX timestamp, defined as the number of seconds, excluding leap seconds, since 01 Jan 1970 00:00:00 UTC. If set, the CPack DEB generator will use its value for timestamps in the package. frozen in time, iconic behavior ๐
๐ฉ CPack DragNDrop Generator ๐ฉ
The DragNDrop CPack generator (macOS) creates a DMG image. drag, drop, done โ that's the whole personality ๐ฑ๏ธโจ
Variables specific to CPack DragNDrop generator ๐โจ
okay so these are the variables that only matter for the DragNDrop installer you build on macOS โ like, the fancy drag-to-Applications disk image situation. every single one, coming right up ๐
CPACK_DMG_VOLUME_NAMEโ the volume name of the generated disk image. yes, the name that shows up when you mount it, main character energy fr fr.
Default: CPACK_PACKAGE_FILE_NAME
CPACK_DMG_FORMATโ the disk image format. the whole vibe of the file, lowkey.
Default: UDZO
common values are UDRO (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF bzip2-compressed). for the tea on other available formats, go check hdiutil(1) โ it has the whole menu ๐ซถ
CPACK_DMG_DS_STOREโ path to a custom.DS_Storefile. bestie, this is the file that specifies the Finder window position/geometry and layout (think hidden toolbars, placement of the icons, all the aesthetic stuff โจ). it has to be generated by the Finder โ either manually or through AppleScript โ using a normal folder from which the.DS_Storefile can then be extracted. no shortcuts, the Finder has to make it ๐CPACK_DMG_DS_STORE_SETUP_SCRIPTโ Added in version 3.5.
path to a custom AppleScript file. this AppleScript is used to generate a .DS_Store file which specifies the Finder window position/geometry and layout (hidden toolbars, placement of the icons, etc., same deal as above). and here's the slay: by specifying a custom AppleScript there's no need to use CPACK_DMG_DS_STORE, because the .DS_Store that gets generated by the AppleScript will be packaged. iconic ๐ธ
CPACK_DMG_BACKGROUND_IMAGEโ Default: (empty)
path to an image file to be used as the background. this file gets copied to .background/background.<ext>, where <ext> is the original image file extension, no cap. the background image is installed into the image before CPACK_DMG_DS_STORE_SETUP_SCRIPT is executed or CPACK_DMG_DS_STORE is installed. by default no background image is set โ sorry, blank canvas bestie ๐จ
CPACK_DMG_DISABLE_APPLICATIONS_SYMLINKโ Added in version 3.6.
default behavior is to include a symlink to /Applications in the DMG. set this option to ON to avoid adding the symlink. that's it, that's the whole thing ๐ฆ
CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSEโ Added in version 3.23.
Default: OFF
this controls whether CPACK_RESOURCE_FILE_LICENSE, if set to a non-default value, is used as the license agreement provided when mounting the DMG. if CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE is not set, cpack(1) defaults to off.
in a CMake project that uses the CPack module to generate CPackConfig.cmake, CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE must be explicitly enabled by the project to activate the SLA. see policy CMP0133 ๐
Note: this option was added in response to macOS 12.0's deprecation of thehdiutil udifrezcommand, to make its use optional. CPack 3.22 and below always useCPACK_RESOURCE_FILE_LICENSE, if set to a non-default value, as the DMG license. so yeah, old behavior was not optional, periodt ๐ญ
CPACK_DMG_SLA_DIRโ Added in version 3.5.
directory where license and menu files for different languages are stored. setting this causes CPack to look for a <language>.menu.txt and <language>.license.txt or <language>.license.rtf file for every language defined in CPACK_DMG_SLA_LANGUAGES. if both this variable and CPACK_RESOURCE_FILE_LICENSE are set, CPack will only look for the menu files and use the same license file for all languages. and if both <language>.license.txt and <language>.license.rtf exist, the .txt file will be used โ .txt wins, sorry rtf girlies ๐
Added in version 3.17: RTF support. ๐
CPACK_DMG_SLA_LANGUAGESโ Added in version 3.5.
languages for which a license agreement is provided when mounting the generated DMG. a menu file consists of 9 lines of text. the first line is the name of the language itself, uppercase, in English (e.g. German). the other lines are translations of the following strings:
- Agree
- Disagree
- Save...
- You agree to the terms of the License Agreement when you click the "Agree" button.
- Software License Agreement
- This text cannot be saved. The disk may be full or locked, or the file may be locked.
- Unable to print. Make sure you have selected a printer.
for every language in this list, CPack will try to find files <language>.menu.txt and <language>.license.txt in the directory specified by the CPACK_DMG_SLA_DIR variable. iykyk ๐
CPACK_DMG_<component>_FILE_NAMEโ Added in version 3.17.
file name when packaging <component> as its own DMG (CPACK_COMPONENTS_GROUPING set to IGNORE).
Default: CPACK_PACKAGE_FILE_NAME-<component>
CPACK_DMG_FILESYSTEMโ Added in version 3.21.
Default: HFS+
the filesystem format. common values are APFS and HFS+. see man hdiutil for a full list of supported formats โ it's giving options ๐
CPACK_COMMAND_HDIUTILโ path to thehdiutil(1)command used to operate on disk image files on macOS. this variable can be used to override the automatically detected command (or specify its location if the auto-detection fails to find it). basically: if the auto-detect is being flaky, you just tell it where the tool lives ๐ซถCPACK_COMMAND_SETFILEโ path to theSetFile(1)command used to set extended attributes on files and directories on macOS. this variable can be used to override the automatically detected command (or specify its location if the auto-detection fails to find it). same energy ๐ฅCPACK_COMMAND_REZโ path to theRez(1)command used to compile resources on macOS. this variable can be used to override the automatically detected command (or specify its location if the auto-detection fails to find it). yes bestie, another "point it at the tool" variable โจCPACK_COMMAND_SYNCโ Added in version 4.2.
path to the sync(8) command used to force completion of pending disk writes on macOS. this variable can be used to override the automatically detected command (or specify its location if the auto-detection fails to find it). flush those buffers, periodt ๐
CPack External Generator ๐
Added in version 3.13.
okay so CPack provides many generators to create packages for a variety of platforms and packaging systems. the intention is for CMake/CPack to be a complete end-to-end solution for building and packaging a software project โ like, the whole arc, main character energy ๐. but it may not always be possible to use CPack for the entire packaging process, due to either technical limitations or policies that require the use of certain tools. and for this reason, CPack provides the "External" generator, which allows external packaging software to take advantage of some of the functionality provided by CPack, such as component installation and the dependency graph. sharing the load, we love to see it ๐ซถ
Integration with External Packaging Tools ๐ง
the CPack External generator generates a .json file containing the CPack internal metadata, which gives external software information on how to package the software. external packaging software may itself invoke CPack, consume the generated metadata, install and package files as required. do your thing bestie, the metadata is right there ๐
alternatively, CPack can invoke an external packaging software through an optional custom CMake script in CPACK_EXTERNAL_PACKAGE_SCRIPT instead. your choice, both are valid ๐ธ
staging of installation files may also optionally be taken care of by the generator when enabled through the CPACK_EXTERNAL_ENABLE_STAGING variable. optional, but handy, ngl โจ
JSON Format ๐ฆ
the JSON metadata file contains a list of CPack components and component groups, the various options passed to cpack_add_component() and cpack_add_component_group(), the dependencies between the components and component groups, and various other options passed to CPack. it's literally the whole picture in one file ๐
the JSON's root object will always provide two fields: formatVersionMajor and formatVersionMinor, which are always integers that describe the output format of the generator. so how does versioning work? backwards-compatible changes to the output format (for example, adding a new field that didn't exist before) cause the minor version to be incremented, and backwards-incompatible changes (for example, deleting a field or changing its meaning) cause the major version to be incremented and the minor version reset to 0. the format version is always of the format major.minor โ in other words, it always has exactly two parts, separated by a period. two parts, no more, no less, periodt ๐
you can request one or more specific versions of the output format as described below with CPACK_EXTERNAL_REQUESTED_VERSIONS. the output format will have a major version that exactly matches the requested major version, and a minor version that is greater than or equal to the requested minor version. if no version is requested with CPACK_EXTERNAL_REQUESTED_VERSIONS, the latest known major version is used by default. currently, the only supported format is 1.0, which is described below. one format, and it's iconic ๐
Version 1.0 ๐ฆ
in addition to the standard format fields, format version 1.0 provides the following fields in the root:
componentsโ thecomponentsfield is an object with component names as the keys and objects describing the components as the values. the component objects have the following fields:nameโ the name of the component. this is always the same as the key in thecomponentsobject. consistency king ๐displayNameโ the value of theDISPLAY_NAMEfield passed tocpack_add_component().descriptionโ the value of theDESCRIPTIONfield passed tocpack_add_component().isHiddenโtrueifHIDDENwas passed tocpack_add_component(),falseif it was not.isRequiredโtrueifREQUIREDwas passed tocpack_add_component(),falseif it was not.isDisabledByDefaultโtrueifDISABLEDwas passed tocpack_add_component(),falseif it was not.groupโ only present ifGROUPwas passed tocpack_add_component(). if so, this field is a string value containing the component's group. it's giving conditional field, love that for us ๐
dependenciesโ an array of the components this component depends on ๐ it's literally just the values you passed in theDEPENDSargument ofcpack_add_component(). NoDEPENDSargument? Then it's an empty list, bestie, no cap.installationTypesโ an array of the installation types this component is part of ๐ it holds the values from theINSTALL_TYPESargument you gave tocpack_add_component(). Didn't passINSTALL_TYPES? Empty list, that's it, periodt.isDownloadedโtrueifDOWNLOADEDwas passed tocpack_add_component(),falseif it wasn't. Simple as, ngl.archiveFileโ the name of the archive file you passed with theARCHIVE_FILEargument tocpack_add_component()๐ฆ if you never passedARCHIVE_FILE, this is an empty string.
โจ componentGroups โจ
The componentGroups field is an object where the keys are component group names and the values are objects describing those component groups ๐ฅ those component group objects have these fields:
nameโ the name of the component group. This is always the same as the key in thecomponentGroupsobject, like, obviously ๐displayNameโ the value of theDISPLAY_NAMEfield that was passed tocpack_add_component_group().descriptionโ the value of theDESCRIPTIONfield that was passed tocpack_add_component_group().parentGroupโ only present ifPARENT_GROUPwas passed tocpack_add_component_group()๐ if it was, this field is a string containing the component group's parent group.isExpandedByDefaultโtrueifEXPANDEDwas passed tocpack_add_component_group(),falseif it was not.isBoldโtrueifBOLD_TITLEwas passed tocpack_add_component_group(),falseif it was not ๐ธcomponentsโ an array of the names of components that are direct members of the group (aka the components that have this group as theirGROUP). Components of subgroups are not included, so don't come for me ๐ซถsubgroupsโ an array of the names of component groups that are subgroups of this group (groups that have this group as theirPARENT_GROUP).
โจ installationTypes โจ
The installationTypes field is an object where the keys are installation type names and the values are objects describing those installation types โจ those objects have these fields:
nameโ the name of the installation type. Always identical to the key in theinstallationTypesobject.displayNameโ the value of theDISPLAY_NAMEfield passed tocpack_add_install_type().indexโ the integer index of the installation type in the list ๐ข
โจ projects โจ
The projects field is an array of objects describing the CMake projects that make up the CPack project ๐ these values are derived from CPACK_INSTALL_CMAKE_PROJECTS. In most cases this is only, like, a single project. The project objects have these fields:
projectNameโ the project name passed toCPACK_INSTALL_CMAKE_PROJECTS.componentโ the name of the component or component set which comprises the project.directoryโ the build directory of the CMake project. This is the directory that contains thecmake_install.cmakescript ๐subDirectoryโ the subdirectory to install the project into, inside the CPack package.
โจ packageName โจ
The package name given in CPACK_PACKAGE_NAME ๐ only present if this option is set.
โจ packageVersion โจ
The package version given in CPACK_PACKAGE_VERSION. Only present if this option is set.
โจ packageDescriptionFile โจ
The package description file given in CPACK_PACKAGE_DESCRIPTION_FILE ๐ only present if this option is set.
โจ packageDescriptionSummary โจ
The package description summary given in CPACK_PACKAGE_DESCRIPTION_SUMMARY. Only present if this option is set.
โจ buildConfig โจ
The build configuration given to CPack with the cpack -C option โญ only present if this option is set.
โจ defaultDirectoryPermissions โจ
The default directory permissions given in CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS. Only present if this option is set.
โจ setDestdir โจ
true if CPACK_SET_DESTDIR is true, false if it is not ๐
โจ packagingInstallPrefix โจ
The install prefix given in CPACK_PACKAGING_INSTALL_PREFIX. Only present if CPACK_SET_DESTDIR is true ๐ (yeah, the presence of this one is tied to CPACK_SET_DESTDIR, not to the prefix variable itself โ that's the vibe).
โจ stripFiles โจ
true if CPACK_STRIP_FILES is true, false if it is not.
โจ warnOnAbsoluteInstallDestination โจ
true if CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION is true, false if it is not ๐
โจ errorOnAbsoluteInstallDestination โจ
true if CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION is true, false if it is not.
๐ Variables specific to CPack External generator ๐
CPACK_EXTERNAL_REQUESTED_VERSIONS
This variable is how you request a specific version of the CPack External generator ๐ it's a list of major.minor values, separated by semicolons.
If this variable is set to a non-empty value, the CPack External generator will iterate through each item in the list looking for a version it knows how to generate ๐ง requested versions should be listed in order of descending preference by the client software, because the first matching version in the list is the one that gets generated. First come, first slay.
The generator "knows how to generate" a version if it has a versioned generator whose major version exactly matches the requested major version, and whose minor version is greater than or equal to the requested minor version. For example, if CPACK_EXTERNAL_REQUESTED_VERSIONS contains 1.0, and the CPack External generator knows how to generate 1.1, it will generate 1.1 โจ if the generator doesn't know how to generate a version in the list, it skips that version and looks at the next one. And if it doesn't know how to generate any of the requested versions? An error is thrown ๐ not the vibe, but that's the rule.
If this variable is not set, or is empty, the CPack External generator will generate the highest major and minor version it knows how to generate ๐
If an invalid version is encountered in CPACK_EXTERNAL_REQUESTED_VERSIONS (one that doesn't match major.minor, where major and minor are integers), it is ignored ๐ซถ
CPACK_EXTERNAL_ENABLE_STAGING
You can set this variable to true to enable optional installation into a temporary staging area, which can then be picked up and packaged by an external packaging tool ๐ the top level directory CPack uses for the current packaging task lives in CPACK_TOPLEVEL_DIRECTORY. It's automatically cleaned up on each run before packaging is initiated, and it can be used for custom temporary files that the external packaging tool needs. It also contains the staging area CPACK_TEMPORARY_DIRECTORY, which is where CPack does the installation when staging is enabled ๐ธ
CPACK_EXTERNAL_PACKAGE_SCRIPT
This variable can optionally specify the full path to a CMake script file that gets run as part of the CPack invocation ๐ฆ it's invoked after the (optional) staging took place and may run an external packaging tool. The script has access to the variables defined by the CPack config file, iykyk.
CPACK_EXTERNAL_BUILT_PACKAGES
Added in version 3.19. โญ
The CPACK_EXTERNAL_PACKAGE_SCRIPT script may set this list variable to the full paths of generated package files ๐ CPack will copy these files from the staging directory back to the top build directory, and possibly produce checksum files if CPACK_PACKAGE_CHECKSUM is set.
๐ง CPack FreeBSD Generator ๐ง
Added in version 3.10.
The built in (binary) CPack FreeBSD (pkg) generator (Unix only) ๐ฅ
Variables affecting the CPack FreeBSD (pkg) generator
- Added in version 3.18:
CPACK_ARCHIVE_THREADS๐
Variables specific to CPack FreeBSD (pkg) generator
The CPack FreeBSD generator may be used to create pkg(8) packages โ and these may be used on FreeBSD, DragonflyBSD, NetBSD, OpenBSD, but also on Linux or OSX, depending on which package-management tools are installed โ using CPack ๐
The CPack FreeBSD generator is a CPack generator and uses the CPACK_XXX variables used by CPack. It tries to reuse packaging information that may already be specified for Debian packages for the CPack DEB Generator ๐ it also tries to reuse RPM packaging information when Debian does not specify.
The CPack FreeBSD generator should work on any host with libpkg installed. The packages it produces are specific to the host architecture and ABI ๐ (so like, don't expect them to be portable across architectures, bestie โ that's not what they're giving).
Okay so the FreeBSD generator does all its package-metadata setting through CPACK_FREEBSD_XXX variables โ iconic, love that for us. And here's the thing bestie: unlike the Deb generator, this one does not specially support componentized packages. Like, not even a little. A single package gets created from all the software artifacts created through CMake. one package, no crumbs, periodt ๐
You can set every one of these variables specifically for FreeBSD packaging โ either in the CPackConfig file or in CMakeLists.txt โ but ngl most of them come with defaults that pull from general settings (like CMAKE_PROJECT_NAME) or from the Debian-specific variables when that actually makes sense (an upstream project's homepage doesn't magically change based on how you package it, bestie ๐). And when there's no Debian info to fall back on but the RPM packaging has it? Then it falls back to the RPM info โ like the package license. slay.
๐ฆ CPACK_FREEBSD_PACKAGE_NAME
Sets the package name โ it shows up in the package manifest, and it also affects the output filename. so it's kind of booked and busy.
- Mandatory: Yes
- Default:
CPACK_PACKAGE_NAME(this is always set by CPack itself, based onCMAKE_PROJECT_NAME).
๐ธ CPACK_FREEBSD_PACKAGE_COMMENT
Sets the package comment. This is the short description that pkg(8) shows off in the standard pkg info output. it's giving "one-line elevator pitch".
- Mandatory: Yes
- Default:
CPACK_PACKAGE_DESCRIPTION_SUMMARY(this is always set by CPack itself, if nothing else sets it explicitly).
๐ CPACK_FREEBSD_PACKAGE_DESCRIPTION
Sets the package description โ the long one, the one pkg info hands you when you pass a specific package as an argument. the full lore, basically ๐
- Mandatory: Yes
- Default:
CPACK_DEBIAN_PACKAGE_DESCRIPTION(this may be set already for Debian packaging, so it gets used as a fallback).CPACK_PACKAGE_DESCRIPTION_SUMMARY(this is always set by CPack itself, if nothing else sets it explicitly).PROJECT_DESCRIPTION(this one can be set with theDESCRIPTIONparameter forproject()).
โจ CPACK_FREEBSD_PACKAGE_WWW
The URL of the web site for this package โ and preferably, when it applies, the site the original source can be obtained from, plus any extra upstream documentation or info you might find there. give the people a place to click ๐ซถ
- Mandatory: Yes
- Default:
CPACK_PACKAGE_HOMEPAGE_URL, or if that is not set,CPACK_DEBIAN_PACKAGE_HOMEPAGE(this may be set already for Debian packaging, so it gets used as a fallback).
Added in version 3.12: the CPACK_PACKAGE_HOMEPAGE_URL variable joined the chat โจ
๐ CPACK_FREEBSD_PACKAGE_LICENSE
The license, or licenses, that apply to this software package. This must be one or more license-identifiers that pkg recognizes as acceptable license identifiers (e.g. "GPLv2"). no improvising, she's picky.
- Mandatory: Yes
- Default:
CPACK_RPM_PACKAGE_LICENSE
๐ CPACK_FREEBSD_PACKAGE_LICENSE_LOGIC
This one only matters if there's more than one license. The default is "single", which โ you guessed it โ only applies to a single license. The other acceptable values are determined by pkg; those are "dual" or "multi", meaning either choice (OR) or simultaneous (AND) application of the licenses. choose your fighter โ๏ธ
- Mandatory: No
- Default:
single
๐ CPACK_FREEBSD_PACKAGE_MAINTAINER
The FreeBSD maintainer of this package (e.g. kde@freebsd.org). your person, your point of contact ๐
- Mandatory: Yes
- Default:
none
๐ง CPACK_FREEBSD_PACKAGE_ORIGIN
The origin (ports label) of this package. For packages built by CPack outside of the ports system this is of less importance โ but the default still parks the package somewhere under misc/, as a stopgap. it's a placeholder bestie, don't read into it.
- Mandatory: Yes
- Default:
misc/<package name>
๐ฅ CPACK_FREEBSD_PACKAGE_CATEGORIES
The ports categories this package lives in (if it were to be built from ports). If none is set, a single category gets determined based on the package origin. girl math, but make it ports.
- Mandatory: Yes
- Default: derived from
ORIGIN
๐ CPACK_FREEBSD_PACKAGE_DEPS
A list of package origins that should be added as package dependencies. These are in the form <category>/<packagename>, e.g. x11/libkonq. No version information needs to be provided โ it's not included in the manifest anyway. so don't stress about semver, it's not that kind of party ๐
- Mandatory: No
- Default: empty
๐ CPack Inno Setup Generator ๐
Added in version 3.27.
Inno Setup is a free installer for Windows programs, by Jordan Russell and Martijn Laan (https://jrsoftware.org/isinfo.php). iconique founder moment.
This documentation explains the options that are specific to the Inno Setup generator.
The generator serves up a lot of options โ components and all that. Unfortunately not every feature (component dependencies, for example) is currently supported by Inno Setup, so the generator just ignores them for now. it's not personal, it's just how she is ๐
โ ๏ธ CPack requires Inno Setup 6 or greater.
Added in version 3.30: the generator is now available on non-Windows hosts too โ but it requires Wine to run the Inno Setup tools. cross-platform slay with a tiny asterisk ๐
๐ฆ Variables specific to CPack Inno Setup generator
You can use the following variables to change the behavior of the CPack INNOSETUP generator:
๐ธ General
None of the following variables is required to be set for the Inno Setup generator to work. If a variable is marked as mandatory below but you don't set it, its default value is taken. so basically nobody has to do anything, and that's the vibe.
The variables can also contain Inno Setup constants like {app}. Please refer to the documentation of Inno Setup for more info on those.
If you're asked to provide the path to any file, you can always give an absolute path, or โ in most cases โ the relative path from the top-level directory where all the files being installed by an install() instruction reside. easy.
CPack tries to escape quotes and other special characters for you. However, using special characters could cause problems. just a lil heads-up ๐ซถ
The following variable simplifies the usage of Inno Setup in CMake:
CPACK_INNOSETUP_USE_CMAKE_BOOL_FORMAT โ Inno Setup only uses yes or no as boolean formats, meanwhile CMake uses a whole zoo of alternative formats like ON or OFF. Turning this option on enables an automatic conversion. consider it a translator bestie.
Consider the following example:
set(CMAKE_INNOSETUP_SETUP_AllowNoIcons OFF)
If this option is turned on, the following line will be created in the output script: AllowNoIcons=no. Else, the following erroneous line will be created: AllowNoIcons=OFF. ๐ญ we love a save.
The conversion is enabled in every Inno Setup specific variable.
- Mandatory: Yes
- Default:
ON
โญ Setup Specific Variables
CPACK_INNOSETUP_ARCHITECTURE โ One of x86, x64, arm64 or ia64. This variable specifies the target architecture of the installer. It also affects the Program Files folder or the registry keys being used โ so like, it has range.
CPack tries to determine the correct value with a try compile (see CMAKE_SIZEOF_VOID_P), but this option can be manually specified too โ especially when you're using ia64 or doing cross-platform compilation.
- Mandatory: Yes
- Default: Either
x86orx64, depending on the results of the try-compile
CPACK_INNOSETUP_INSTALL_ROOT โ If you don't want the installer to create the installation directory under Program Files, you've got to specify the installation root here.
The full directory of the installation will be: ${CPACK_INNOSETUP_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}.
- Mandatory: Yes
- Default:
{autopf}
CPACK_INNOSETUP_ALLOW_CUSTOM_DIRECTORY โ If turned on, the installer lets the user change the installation directory by giving them an extra wizard page. user agency, we love to see it โจ
- Mandatory: Yes
- Default:
ON
CPACK_INNOSETUP_PROGRAM_MENU_FOLDER โ The initial name of the start menu folder being created.
If this variable is set to ., then no separate folder is created and the application shortcuts will appear right in the top-level start menu folder. minimalism, but make it Windows.
- Mandatory: Yes
- Default: The value of
CPACK_PACKAGE_NAME
CPACK_INNOSETUP_LANGUAGES โ A semicolon-separated list of the languages you want Inno Setup to include. multilingual queen ๐
Currently available: armenian, brazilianPortuguese, bulgarian, catalan, corsican, czech, danish, dutch, english, finnish, french, german, hebrew, icelandic, italian, japanese, norwegian, polish, portuguese, russian, slovak, slovenian, spanish, turkish and ukrainian. This list might differ depending on the version of Inno Setup โ so like, check your own install, iykyk.
- Mandatory: Yes
- Default:
english
CPACK_INNOSETUP_IGNORE_LICENSE_PAGE โ If you don't specify a license file using CPACK_RESOURCE_FILE_LICENSE, CPack uses a file for demonstration purposes. If you want the installer to ignore license files entirely, you can enable this option.
- Mandatory: Yes
- Default:
OFF
CPACK_INNOSETUP_IGNORE_README_PAGE โ If you don't specify a readme file using CPACK_RESOURCE_FILE_README, CPack uses a file for demonstration purposes. If you want the installer to ignore readme files entirely, you can enable this option. > Make sure the option is disabled when you're using a custom readme file. don't shoot yourself in the foot bestie ๐
- Mandatory: Yes
- Default โ
ON(yeah, finishing off the last one from before, we're still rolling ๐ซ) CPACK_INNOSETUP_PASSWORDโ turns on password protection and file encryption, using whatever password you hand it ๐- Mandatory โ No
CPACK_INNOSETUP_USE_MODERN_WIZARDโ gives you the modern look-and-feel that Inno Setup provides โจ flip it off and you get the classic style instead. Heads up: images and icon files are affected by this too, it's not just the chrome ๐- Mandatory โ Yes
- Default โ
OFFbecause of compatibility reasons (the classic look stays winning for now ๐ )
CPACK_INNOSETUP_ICON_FILEโ the path to a custom installer.icofile ๐ผ๏ธ- Oh and btw, use
CPACK_PACKAGE_ICON(that's the variable) to customize the bitmap file that gets shown in the wizard. - Mandatory โ No
- Oh and btw, use
CPACK_INNOSETUP_SETUP_<directive>โ this whole group is your "adapt anything" pass for the[Setup]section directives that Inno Setup provides, where directive is the directive's name ๐- Some examples, because examples ate:
set(CPACK_INNOSETUP_SETUP_WizardSmallImageFile "my_bitmap.bmp")
set(CPACK_INNOSETUP_SETUP_AllowNoIcons OFF) # This requires CPACK_INNOSETUP_USE_CMAKE_BOOL_FORMAT to be on
- Real talk: all of these variables have higher priority than the others. Consider this little situation:
set(CPACK_INNOSETUP_SETUP_Password "admin")
set(CPACK_INNOSETUP_PASSWORD "secret")
The password will be admin at the end, because CPACK_INNOSETUP_PASSWORD has less priority than CPACK_INNOSETUP_SETUP_Password. The specific one wins, periodt ๐
- Mandatory โ No
File Specific Variables ๐๏ธ
So like, every file that gets installed by an install() command is automatically processed and added to the installer โ that's just the vibe. But there are some variables to customize the installation process if you wanna get hands-on ๐ซถ
Before using executables (only .exe or .com, nothing else bestie) in shortcuts (e.g. CPACK_CREATE_DESKTOP_LINKS) or [Run] entries, you've got to add the raw file name โ no path, no extension โ to CPACK_PACKAGE_EXECUTABLES and create a start menu shortcut for them.
โ ๏ธ If you have two files with the same raw name (e.g.a/executable.exeandb/executable.com), an entry in the section is created twice. That results in undefined behavior and is not recommended. Don't do it ๐
CPACK_INNOSETUP_CUSTOM_INSTALL_INSTRUCTIONSโ this variable should contain a semicolon-separated list (yk, a CMake list) of pairs of path, instruction, and it lets you customize the install command that gets automatically created for each file or directory โ๏ธ- CPack creates the following Inno Setup instruction for every file...
Source: "absolute\path\to\my_file.txt"; DestDir: "{app}"; Flags: ignoreversion
- ...and the following line for every directory:
Name: "{app}\my_folder"
- Say you wanna change the destination directory or the flags of
my_file.txt. Since we can also provide a relative path, the line you'd like to have is this one:
Source: "my_file.txt"; DestDir: "{userdocs}"; Flags: ignoreversion uninsneveruninstall
- You'd pull that off by using
my_file.txtas path andSource: "my_file.txt"; DestDir: "{userdocs}"; Flags: ignoreversion uninsneveruninstallas instruction. - You've got to take care of the escaping problem (it's a whole thing, see
https://cmake.org/cmake/help/book/mastering-cmake/chapter/Packaging%20With%20CPack.html#adding-custom-cpack-options๐ญ). So the CMake command would be:
set(CPACK_INNOSETUP_CUSTOM_INSTALL_INSTRUCTIONS "my_file.txt;Source: \\\"my_file.txt\\\"\\; DestDir: \\\"{userdocs}\\\"\\; Flags: ignoreversion uninsneveruninstall")
- To improve readability, you should go around the escaping problem entirely by using
CPACK_VERBATIM_VARIABLESor by placing the instruction into a separate CPack project config file. Do yourself the favor ๐ง - If you customize the install instruction of a specific file, you lose the connection to its component. To go around that, manually add
Components: <component>. You also need to add its shortcuts and[Run]entries by yourself in a custom section, since the executable won't be found anymore byCPACK_PACKAGE_EXECUTABLES. Yeah, it's giving manual labor ๐ - Here's another example (Note: you've got to go around the escaping problem for the example to work):
set(CPACK_INNOSETUP_CUSTOM_INSTALL_INSTRUCTIONS
"component1/my_folder" "Name: \"{userdocs}\\my_folder\"\; Components: component1"
"component2/my_folder2/my_file.txt" "Source: \"component2\\my_folder2\\my_file.txt\"\; DestDir: \"{app}\\my_folder2\\my_file.txt\"\; Flags: ignoreversion uninsneveruninstall\; Components: component2")
- Mandatory โ No
CPACK_INNOSETUP_MENU_LINKSโ this one should contain a semicolon-separated list (CMake list, you know the drill) of pairs of link, link name, and it adds shortcuts into the start menu folder beside those of the executables (seeCPACK_PACKAGE_EXECUTABLES) ๐ While link name is the label, link can be a URL or a path relative to the installation directory.- Here's an example:
set(CPACK_INNOSETUP_MENU_LINKS
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html"
"CMake Help" "https://cmake.org" "CMake Web Site")
- Mandatory โ No
CPACK_INNOSETUP_CREATE_UNINSTALL_LINKโ turn this on and a shortcut to the application's uninstaller is automatically added to the start menu folder ๐๏ธ- Mandatory โ Yes
- Default โ
OFF
CPACK_INNOSETUP_RUN_EXECUTABLESโ a semicolon-separated list (CMake list ๐ซ) of executables being specified inCPACK_PACKAGE_EXECUTABLESwhich the user can run when the installer finishes. They're internally added to the[Run]section ๐โโ๏ธ- Mandatory โ No
Components Specific Variables ๐งฉ
The generator supports components and also downloaded components, slay. However, there are some features of components that aren't supported yet (especially component dependencies). These variables are ignored for now, no cap.
CPack will change a component's name in Inno Setup if it has a parent group, for technical reasons. So consider using group\component as the component name in Inno Setup scripts if you have the component component and its parent group group. iykyk ๐
Here are some additional variables for components:
CPACK_INNOSETUP_<compName>_INSTALL_DIRECTORYโ if you don't want the component compName to be installed under{app}, you've got to specify its installation directory here ๐- Mandatory โ No
CPACK_INNOSETUP_VERIFY_DOWNLOADSโ this option only affects downloaded components โ ๏ธ- If it's turned on, the hashes of the downloaded archives are calculated during compile and download time. The installer will only proceed if they match. Security check, we stan ๐ฅ
- Mandatory โ Yes
- Default โ
ON
Compilation and Scripting Specific Variables ๐ ๏ธ
CPACK_INNOSETUP_EXECUTABLEโ the filename of the Inno Setup Script Compiler command ๐ฅ๏ธ- Mandatory โ Yes
- Default โ
ISCC
CPACK_INNOSETUP_EXECUTABLE_ARGUMENTSโ a semicolon-separated list (CMake list bestie ๐) of extra command-line options for the Inno Setup Script Compiler command.- For example:
/Qp;/Smysigntool=$p - Take care of the escaping problem (
https://cmake.org/cmake/help/book/mastering-cmake/chapter/Packaging%20With%20CPack.html#adding-custom-cpack-options) ๐ญ - Mandatory โ No
- For example:
CPACK_INNOSETUP_DEFINE_<macro>โ this group lets you add custom define directives as command-line options to the Inno Setup Preprocessor command. Each entry emulates a#define public <macro>directive, and its macro is accessible from anywhere (public!), so it can also be used in extra script files ๐- Macro names must not contain any special characters. Refer to the Inno Setup Preprocessor documentation for the detailed rules, fr fr.
- Consider the following example:
# The following line emulates: #define public MyMacro "Hello, World!"
set(CPACK_INNOSETUP_DEFINE_MyMacro "Hello, World!")
- At this point, you can use
MyMacroanywhere. For example in the following extra script:
AppComments={#emit "'My Macro' has the value: " + MyMacro}
- Take care of the escaping problem (
https://cmake.org/cmake/help/book/mastering-cmake/chapter/Packaging%20With%20CPack.html#adding-custom-cpack-options) ๐ซ - Mandatory โ No
CPACK_INNOSETUP_EXTRA_SCRIPTSโ a semicolon-separated list (CMake list ๐) of paths to additional.issscript files to be processed.- They're internally included at the top of the output script file using a
#includedirective. - You can add any section in your file to extend the installer (e.g. adding additional tasks or registry keys). But prefer using
CPACK_INNOSETUP_SETUP_<directive>when extending the[Setup]section ๐ - Mandatory โ No
- They're internally included at the top of the output script file using a
CPACK_INNOSETUP_CODE_FILESโ a semicolon-separated list (CMake list โจ) of paths to additional Pascal files to be processed.- This variable is actually the same as
CPACK_INNOSETUP_EXTRA_SCRIPTS, except you don't have to add[Code]at the top of your file. - > ๐ Never change the current section in a code file. This will result in undefined behavior! Treat them as normal Pascal scripts instead. I'm so serious, bestie.
- Code files are included at the very bottom of the output script.
- Mandatory โ No
- This variable is actually the same as
CPack IFW Generator ๐ง
Added in version 3.1.
Configure and run the Qt Installer Framework to generate a Qt installer. Okay this one's iconic ๐
Overview
This cpack generator generates configuration and meta information for the Qt Installer Framework (https://doc.qt.io/qtinstallerframework/index.html) โ QtIFW for short โ and runs QtIFW tools to generate a Qt installer ๐ธ
QtIFW provides tools and utilities to create installers for the platforms supported by Qt (https://www.qt.io): Linux, Microsoft Windows, and macOS. All three of them, we love a cross-platform moment ๐ฆ
To make use of this generator, QtIFW needs to be installed. The CPackIFW module hunts down where the QtIFW command-line utilities are living, and it defines a bunch of commands to control how this generator behaves. See Hints for Finding QtIFW. ๐ต๏ธโโ๏ธ
Variables ๐งฉ
You can use the following variables to change the behavior of the CPack IFW generator. Yes, all of them. There are a lot. Grab a snack. ๐
Debug ๐
CPACK_IFW_VERBOSEโ Added in version 3.3. Set it toONto get addition debug output. It'sOFFby default bestie, so flip it if you wanna peek under the hood. ๐
Package ๐ฆ
CPACK_IFW_PACKAGE_TITLEโ the name of the installer, the way it shows up on the title bar. If you don't specify it, it just defaults toCPACK_PACKAGE_DESCRIPTION_SUMMARY. โจCPACK_IFW_PACKAGE_PUBLISHERโ who's publishing this software, as shown in the Windows Control Panel. If it's not specified, it defaults toCPACK_PACKAGE_VENDOR. ๐CPACK_IFW_PRODUCT_URLโ a URL to a page on your web site that has product info. Link it up. ๐CPACK_IFW_PACKAGE_ICONโ filename for a custom installer icon. It must be an absolute path. This should be a.icnsfile on macOS and a.icofile on Windows. It's ignored on other platforms, so don't stress about it elsewhere. ๐CPACK_IFW_PACKAGE_WINDOW_ICONโ filename for a custom window icon in PNG format for the Installer application. Absolute path, no exceptions. ๐ชCPACK_IFW_PACKAGE_LOGOโ filename for a logo image in PNG format, used asQWizard::LogoPixmap. Absolute path required. ๐CPACK_IFW_PACKAGE_WATERMARKโ Added in version 3.8. Filename for a watermark image in PNG format, used asQWizard::WatermarkPixmap. Must be an absolute path. ๐งCPACK_IFW_PACKAGE_BANNERโ Added in version 3.8. Filename for a banner image in PNG format, used asQWizard::BannerPixmap. Absolute path, always. ๐ณ๏ธCPACK_IFW_PACKAGE_BACKGROUNDโ Added in version 3.8. Filename for a background image in PNG format, used asQWizard::BackgroundPixmap(and it's only used byMacStyle, iykyk). Must be an absolute path. ๐CPACK_IFW_PACKAGE_WIZARD_STYLEโ Added in version 3.8. The wizard style to be used:Modern,Mac,AeroorClassic. Pick your vibe. ๐ซCPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTHโ Added in version 3.8. Default width of the wizard, in pixels. Heads up: setting a banner image will override this. ๐CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHTโ Added in version 3.8. Default height of the wizard, in pixels. And setting a watermark image will override this one. ๐CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LISTโ Added in version 3.20. Set toOFFif you don't want the widget listing installer pages on the left side of the wizard to show. It'sONby default, but it will only have an effect if using QtIFW 4.0 or later. ๐ซฅCPACK_IFW_PACKAGE_TITLE_COLORโ Added in version 3.8. Color of the titles and subtitles. It takes an HTML color code, such as#88FF33. ๐CPACK_IFW_PACKAGE_STYLE_SHEETโ Added in version 3.15. Filename for a stylesheet. It must be an absolute path. Slay that styling. ๐CPACK_IFW_TARGET_DIRECTORYโ the default target directory for installation. IfCPACK_PACKAGE_INSTALL_DIRECTORYis set, this defaults to@ApplicationsDir@/${CPACK_PACKAGE_INSTALL_DIRECTORY}. If that variable isn't set either, the default used is@RootDir@/usr/local. Those predefined variables of the form@...@get expanded by the QtIFW scripting engine, fr fr. ๐๏ธCPACK_IFW_ADMIN_TARGET_DIRECTORYโ the default target directory for installation with administrator rights. You can use predefined variables here too. ๐CPACK_IFW_PACKAGE_REMOVE_TARGET_DIRโ Added in version 3.11. Set toOFFif the target directory should not be deleted when uninstalling. It isONby default. ๐๏ธCPACK_IFW_PACKAGE_GROUPโ the group which will be used to configure the root package. ๐ฏCPACK_IFW_PACKAGE_NAMEโ the root package name, used if the configuration group is not specified. ๐ท๏ธCPACK_IFW_PACKAGE_START_MENU_DIRECTORYโ Added in version 3.3. Name of the default program group for the product in the Windows Start menu. If not specified, it defaults toCPACK_IFW_PACKAGE_NAME. ๐ชCPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAMEโ Added in version 3.3. Filename of the generated maintenance tool. The platform-specific executable file extension will be appended for you. If not specified, QtIFW provides a default name (maintenancetool). ๐งCPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILEโ Added in version 3.3. Filename for the configuration of the generated maintenance tool. If not specified, QtIFW uses a default file name (maintenancetool.ini). ๐CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERSโ Added in version 3.3. Set toONif the installation path can contain non-ASCII characters. Only supported for QtIFW 2.0 and later โ older QtIFW versions will always allow non-ASCII characters anyway. ๐CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATHโ Added in version 3.3. Set toOFFif the installation path cannot contain space characters. It isONfor QtIFW less 2.0 tools. โฃCPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACEโ Added in version 3.23. Set toONif command line interface features should be disabled. It isOFFby default and will only have an effect if using QtIFW 4.0 or later. ๐ฅ๏ธCPACK_IFW_PACKAGE_CONTROL_SCRIPTโ Added in version 3.3. Filename for a custom installer control script. ๐CPACK_IFW_PACKAGE_RESOURCESโ Added in version 3.7. List of additional resources (.qrcfiles) to include in the installer binary. They should be specified as absolute paths, and no two resource files can have the same file name. You can use thecpack_ifw_add_package_resources()command to resolve relative paths. ๐งบCPACK_IFW_PACKAGE_FILE_EXTENSIONโ Added in version 3.10. The target binary extension. Ok so: on Linux, the name of the target binary is automatically extended with.runif you don't specify the extension. On Windows, the target is created as an application with the extension.exe, which is automatically added if not supplied. On Mac, the target is created as a DMG disk image with the extension.dmg, which is automatically added if not supplied. Cute, right? ๐ฝCPACK_IFW_REPOSITORIES_ALLโ the list of remote repositories. The default value of this variable is computed by CPack and contains all repositories added withcpack_ifw_add_repository()or updated withcpack_ifw_update_repository(). ๐CPACK_IFW_DOWNLOAD_ALLโ if this isON, all components will be downloaded. If it's not set, the behavior is determined by whethercpack_configure_downloads()has been called with theALLoption or not. โฌ๏ธCPACK_IFW_PACKAGE_PRODUCT_IMAGESโ Added in version 3.23. A list of images to be shown on thePerformInstallationPage. These must be absolute paths, and the images must be in PNG format. This feature is available for QtIFW 4.0.0 and later. ๐ผ๏ธCPACK_IFW_PACKAGE_PRODUCT_IMAGE_URLSโ Added in version 3.31. A list of URLs associated with the ProductImages. Only used ifCPACK_IFW_PACKAGE_PRODUCT_IMAGESis defined and it has the same size. This feature is available for QtIFW 4.0.0 and later. ๐CPACK_IFW_PACKAGE_RUN_PROGRAMโ Added in version 3.23. Command executed after the installer is finished, if the user accepts the action. Provide the full path to the application, as found when installed. This typically means the path should begin with the QtIFW predefined variable@TargetDir@. This feature is available for QtIFW 4.0.0 and later. ๐CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTSโ Added in version 3.23. List of arguments passed to the program specified inCPACK_IFW_PACKAGE_RUN_PROGRAM. This feature is available for QtIFW 4.0.0 and later. ๐งพCPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTIONโ Added in version 3.23. Text shown next to the check box for running the program after the installation. IfCPACK_IFW_PACKAGE_RUN_PROGRAMis set but no description is provided, QtIFW will use a default message likeRun <Name> now.This feature is available for QtIFW 4.0.0 and later. ๐ฌCPACK_IFW_PACKAGE_SIGNING_IDENTITYโ Added in version 3.23. Lets you specify a code signing identity to be used for signing the generated app bundle. Only available on macOS โ ignored on other platforms, sorry besties. ๐CPACK_IFW_ARCHIVE_FORMATโ Added in version 3.23. Sets the format used when packaging new component data archives. If you omit this option, the7zformat will be used as a default. Supported formats:7zziptar.gztar.bz2tar.xz
Note: If the Qt Installer Framework tools were built without libarchive support, only 7z format is supported. ๐
This feature is available for QtIFW 4.2.0 and later. ๐ฆ
CPACK_IFW_ARCHIVE_COMPRESSIONโ Added in version 3.23. Archive compression level. The allowable values are:0(No compression)1(Fastest compression)3(Fast compression)5(Normal compression)7(Maximum compression)9(Ultra compression)
If this variable is not set, QtIFW will use a default compression level, which will typically be 5 (Normal compression).
Note: Some formats do not support all the possible values. For examplezipcompression only supports values from1to7. Keep that in mind, ok? ๐
This feature is available for QtIFW 4.2.0 and later. ๐๏ธ
Components ๐งฑ
CPACK_IFW_RESOLVE_DUPLICATE_NAMESโ resolve duplicate names when installing components with groups. Iconic behavior honestly. ๐ซถCPACK_IFW_PACKAGES_DIRECTORIESโ extra directories full of already-prepped packages that get used to resolve dependent components ๐ซถCPACK_IFW_REPOSITORIES_DIRECTORIESโ Added in version 3.10. More directories of already-prepared repositories, used to resolve and repack dependent components. Heads up: this one's only a thing on QtIFW 3.1 and later โจ
๐งฐ QtIFW Tools
CPACK_IFW_FRAMEWORK_VERSIONโ Added in version 3.3. Which version of the QtIFW tools you're rolling with. TheCPackIFWmodule sets this bad boy for you.
The next batch are the locations of the QtIFW command-line tools, as found by the CPackIFW module. They're cached, so you can configure them yourself if the auto-detect is being weird ๐
CPACK_IFW_ARCHIVEGEN_EXECUTABLEโ Added in version 3.19. Path toarchivegen.CPACK_IFW_BINARYCREATOR_EXECUTABLEโ Path tobinarycreator.CPACK_IFW_REPOGEN_EXECUTABLEโ Path torepogen.CPACK_IFW_INSTALLERBASE_EXECUTABLEโ Path toinstallerbase.CPACK_IFW_DEVTOOL_EXECUTABLEโ Path todevtool.
๐ Hints for Finding QtIFW
okay so normally the CPack IFW generator just finds the QtIFW tools on its own, no drama. But if you wanna give it a nudge, you can set any of the following to add to the places find_program() already searches โ and they're listed in order of precedence ๐
CPACK_IFW_ROOTโ Added in version 3.9. As a CMake variable.CPACK_IFW_ROOTโ Added in version 3.9. As an environment variable.QTIFWDIRโ As a CMake variable.QTIFWDIRโ As an environment variable.
โ ๏ธ bestie listen โ the path you give should not havebinstuck on the end. Like, it should look likeD:\DevTools\QtIFW2.0.5, not the bin folder inside it. ๐
๐๏ธ Other Settings
๐ Online installer
So by default this generator makes you an offline installer, meaning literally every packaged file is fully tucked inside the installer executable. Cute, self-contained, chunky.
An online installer is the opposite vibe: it downloads some or all of the components from a remote server. ๐
- The
DOWNLOADEDoption in thecpack_add_component()command says "this component gets downloaded." - Or alternatively, the
ALLoption in thecpack_configure_downloads()command says "okay download everything."
And if you want something more specific, the cpack_ifw_add_repository() command plus the CPACK_IFW_DOWNLOAD_ALL variable have you covered ๐
When you do have online components, CPack writes them out to archive files. The CPackComponent module's help page โ especially the bit about the cpack_configure_downloads() function โ explains how to make those files reachable from a download URL. โจ
๐ Internationalization
Added in version 3.9.
Some variables and command arguments support internationalization through the CMake script. It's optional, no pressure. ๐ฆ
Installers made by QtIFW tools already have built-in i18n and loads of phrases are localized into many languages โ but that does not cover the description of your components and groups. ๐ญ
Localizing those descriptions is genuinely useful for the people using your installers, so likeโฆ do it.
A localized variable or argument can hold a single default value, and then after that, a set of pairs: the locale name, and the localized value.
For example:
set(LOCALIZABLE_VARIABLE "Default value"
en "English value"
en_US "American value"
en_GB "Great Britain value"
)
๐ See Also
Qt Installer Framework Manual:
- Index page:
https://doc.qt.io/qtinstallerframework/index.html - Component Scripting:
https://doc.qt.io/qtinstallerframework/scripting.html - Predefined Variables:
https://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables - Promoting Updates:
https://doc.qt.io/qtinstallerframework/ifw-updates.html
Download Qt Installer Framework for your platform from the Qt site: https://download.qt.io/official_releases/qt-installer-framework
๐ช CPack NSIS Generator
CPack Nullsoft Scriptable Install System (NSIS) generatorโspecific options. Yes, that's the real full name, no cap. ๐
Changed in version 3.22: the NSIS generator needs NSIS 3.03 or newer. Old NSIS? Not invited to the party.
๐งฉ Variables specific to CPack NSIS generator
These are the variables that belong specifically to the graphical installers built on Windows with Nullsoft Scriptable Install System. Let's go ๐
CPACK_NSIS_INSTALL_ROOTโ the default install directory the NSIS installer shows your user lives under this root dir. The full directory the user actually sees is:${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}CPACK_NSIS_MUI_ICONโ an icon filename, bestie. The name of a*.icofile used as the main icon for the generated install program. ๐CPACK_NSIS_MUI_UNIICONโ another icon filename. The name of a*.icofile used as the main icon for the generated uninstall program.CPACK_NSIS_INSTALLER_MUI_ICON_CODEโundocumented.(yes, that's literally it. iconic honestly ๐)CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAPโ Added in version 3.5. The filename of a bitmap to use as the NSISMUI_WELCOMEFINISHPAGE_BITMAP.CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAPโ Added in version 3.5. The filename of a bitmap to use as the NSISMUI_UNWELCOMEFINISHPAGE_BITMAP.CPACK_NSIS_EXTRA_PREINSTALL_COMMANDSโ extra NSIS commands that get dropped at the beginning of the install Section, before your install tree even exists on the target system.CPACK_NSIS_EXTRA_INSTALL_COMMANDSโ extra NSIS commands that get dropped at the end of the install Section, after your install tree is available on the target system.CPACK_NSIS_EXTRA_UNINSTALL_COMMANDSโ extra NSIS commands that get added to the uninstall Section, before your install tree gets removed from the target system.CPACK_NSIS_COMPRESSORโ the arguments that get passed to the NSISSetCompressorcommand.CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALLโ asks about uninstalling previous versions first. If you set this toON, the installer goes looking for previously installed versions, and if it finds one it asks the user whether to uninstall it before carrying on with the install. ๐ซถCPACK_NSIS_MODIFY_PATHโ the Modify PATH toggle. Set it toONand an extra page pops up in the installer letting the user choose whether the program directory should be added to the systemPATHvariable. Lowkey the most-requested checkbox of all time.CPACK_NSIS_DISPLAY_NAMEโ the display name string that shows up in Windows Apps & features in Control Panel.CPACK_NSIS_PACKAGE_NAMEโ the title displayed at the top of the installer.CPACK_NSIS_INSTALLED_ICON_NAMEโ a path to the executable that contains the installer icon.CPACK_NSIS_HELP_LINKโ URL to a web site that helps people install your application.CPACK_NSIS_URL_INFO_ABOUTโ URL to a web site with more info about your application.CPACK_NSIS_CONTACTโ contact info for questions and comments about the installation process.CPACK_NSIS_<compName>_INSTALL_DIRECTORYโ Added in version 3.7. A custom install directory for the component named<compName>, instead of$INSTDIR.CPACK_NSIS_CREATE_ICONS_EXTRAโ additional NSIS commands for creating Start Menu shortcuts.CPACK_NSIS_DELETE_ICONS_EXTRAโ additional NSIS commands to uninstall Start Menu shortcuts.CPACK_NSIS_EXECUTABLES_DIRECTORYโ creating NSIS Start Menu links assumes they live inbinunless you set this variable. Like, you'd set it toexecif your executables are in anexecdirectory. iykyk ๐CPACK_NSIS_MUI_FINISHPAGE_RUNโ specify an executable to add an option to run on the finish page of the NSIS installer. ๐CPACK_NSIS_MENU_LINKSโ specify links in the[application]menu. This should contain a list of pairs: link, link name. The link can be a URL or a path relative to the installation prefix. Like this:
set(CPACK_NSIS_MENU_LINKS
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html"
"CMake Help" "https://cmake.org" "CMake Web Site")
CPACK_NSIS_UNINSTALL_NAMEโ Added in version 3.17. Specify the name of the program to uninstall the version. Default isUninstall.CPACK_NSIS_WELCOME_TITLEโ Added in version 3.17. The title to display at the top of the page for the welcome page.CPACK_NSIS_WELCOME_TITLE_3LINESโ Added in version 3.17. Display the title on the welcome page on 3 lines instead of 2.CPACK_NSIS_FINISH_TITLEโ Added in version 3.17. The title to display at the top of the page for the finish page.CPACK_NSIS_FINISH_TITLE_3LINESโ Added in version 3.17. Display the title in the finish page on 3 lines instead of 2.CPACK_NSIS_MUI_HEADERIMAGEโ Added in version 3.17. The image to display on the header of installer pages. ๐ธCPACK_NSIS_MANIFEST_DPI_AWAREโ Added in version 3.18. If set, it declares that the installer is DPI-aware. โจCPACK_NSIS_BRANDING_TEXTโ Added in version 3.20. If set, updates the text at the bottom of the install window. Wanna set the string to blank? Use a space (" "). That's the move.CPACK_NSIS_BRANDING_TEXT_TRIM_POSITIONโ Added in version 3.20. If set, trims down the size of the control to the size of the branding text string. Allowed values areLEFT,CENTERorRIGHT. If you don't specify one, the default behavior isLEFT.CPACK_NSIS_EXECUTABLEโ Added in version 3.21. If set, specifies the name of the NSIS executable. Default ismakensis.CPACK_NSIS_IGNORE_LICENSE_PAGEโ Added in version 3.22. If set, don't display the page containing the license during installation. (we're all clicking accept anyway ๐)CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTSโ Added in version 3.25. This variable is a semicolon-separated list of arguments to prepend to the nsis script that gets run. If the arguments don't start with a/or a-, it'll automatically add one to the corresponding arguments. The command that ends up running is:
makensis.exe <preArgs>... "nsisFileName.nsi" <postArgs>...
...where <preArgs>... gets built from CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS, and <postArgs>... gets built from CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS. The whole thing it runs is literally:
makensis.exe <preArgs>... "nsisFileName.nsi" <postArgs>...
CPACK_NSIS_CRC_CHECKโ added in version 4.2. Controls whether the installer does a CRC on itself before it'll let the install happen (self-care check, honestly iconic of it ๐ซถ). Allowed values areon,off, andforce. If you don't set it, the default behavior ison.CPACK_NSIS_IGNORE_COMPONENTS_PAGEโ added in version 4.4. If it's set, the installer will not show the page containing the license during installation. That's it, that's the whole vibe.
๐ฌ CPack NuGet Generator
Added in version 3.12.
Okay so real talk: when you build a NuGet package there is no direct way to control an output filename, because NuGet just doesn't have the corresponding CLI option for it. So there's no CPACK_NUGET_PACKAGE_FILE_NAME variable, sorry bestie ๐ญ. To form the output filename, NuGet uses the package name and the version according to its own built-in rules. Not our call!
Also, be aware that including a top level directory (CPACK_INCLUDE_TOPLEVEL_DIRECTORY) is ignored by this generator. Like, straight up ignored. ๐
โจ Variables specific to CPack NuGet generator
The CPack NuGet generator is what you use to create NuGet packages with CPack. And because it is a CPack generator, it uses all the CPACK_XXX variables that CPack itself uses โ same family, same energy.
On top of that, it has its own little specifics, controlled by the CPACK_NUGET_XXX variables. And heads up: in the "one per group" mode (peep CPACK_COMPONENTS_GROUPING), the <compName> placeholder in the variables below holds a group name โ uppercased and turned into a "C" identifier. Cute, right? ๐
Here's the list of CPack NuGet generator specific variables:
CPACK_NUGET_COMPONENT_INSTALLโ enables component packaging for the CPack NuGet generator.- Mandatory โ No
- Default โ
OFF
CPACK_NUGET_PACKAGE_DEBUGโ enables debug messages while the CPack NuGet generator is executing (for when you need to see what's actually going on ๐).- Mandatory โ No
- Default โ
OFF
CPACK_NUGET_SYMBOL_PACKAGEโ added in version 4.1. generates a NuGet symbol package (.snupkg).- Mandatory โ No
- Default โ
OFF
๐ Required metadata variables
Okay these next ones? Mandatory. Like, you must set them, no cap. ๐
CPACK_NUGET_PACKAGE_NAME,CPACK_NUGET_<compName>_PACKAGE_NAMEโ the NuGet package name.CPACK_NUGET_PACKAGE_NAMEis what gets used as the package id on nuget.org (the site lives athttps://www.nuget.org).- Mandatory โ Yes
- Default โ
CPACK_PACKAGE_NAME
CPACK_NUGET_PACKAGE_VERSION,CPACK_NUGET_<compName>_PACKAGE_VERSIONโ the NuGet package version.- Mandatory โ Yes
- Default โ
CPACK_PACKAGE_VERSION
CPACK_NUGET_PACKAGE_DESCRIPTION,CPACK_NUGET_<compName>_PACKAGE_DESCRIPTIONโ a long description of the package, for UI display. The whole "tell me about yourself" moment โจ.- Mandatory โ Yes
- Default โ one of:
CPACK_COMPONENT_<compName>_DESCRIPTIONCPACK_COMPONENT_GROUP_<groupName>_DESCRIPTIONCPACK_PACKAGE_DESCRIPTION
CPACK_NUGET_PACKAGE_AUTHORS,CPACK_NUGET_<compName>_PACKAGE_AUTHORSโ a comma-separated list of package authors, matching the profile names on nuget.org (https://www.nuget.org). These show up in the NuGet Gallery on nuget.org (https://www.nuget.org) and get used to cross-reference packages by the same authors. Main character credits, basically ๐.- Mandatory โ Yes
- Default โ
CPACK_PACKAGE_VENDOR
๐ Optional metadata variables
These ones are the vibe-optional extras โ set them if you want your package looking extra polished. ๐ฆ
CPACK_NUGET_PACKAGE_OWNERS,CPACK_NUGET_<compName>_PACKAGE_OWNERSโ deprecated since version 3.20: use authors (CPACK_NUGET_PACKAGE_AUTHORS) instead. A comma-separated list of the package creators using profile names on nuget.org (https://www.nuget.org). This is often the same list as in authors, and it's ignored when uploading the package to nuget.org (https://www.nuget.org).- Mandatory โ No
- Default โ None
CPACK_NUGET_PACKAGE_HOMEPAGE_URL,CPACK_NUGET_<compName>_PACKAGE_HOMEPAGE_URLโ a URL for the package's home page, often shown in UI displays as well as on nuget.org (https://www.nuget.org).- Mandatory โ No
- Default โ
CPACK_PACKAGE_HOMEPAGE_URL
CPACK_NUGET_PACKAGE_LICENSEURL,CPACK_NUGET_<compName>_PACKAGE_LICENSEURLโ deprecated since version 3.20: use a local license file (CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME) or a SPDX license identifier (CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION) instead. A URL for the package's license, often shown in UI displays as well as on nuget.org (https://www.nuget.org).- Mandatory โ No
- Default โ None
- Supported โ NuGet 4.9.0 and above
CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME,CPACK_NUGET_<compName>_PACKAGE_LICENSE_FILE_NAMEโ added in version 3.20. the package's license file, in.txtor.mdformat. Careful bestie: ifCPACK_NUGET_PACKAGE_LICENSE_FILE_NAMEis specified,CPACK_NUGET_PACKAGE_LICENSE_EXPRESSIONis ignored.- Mandatory โ No
- Default โ None
- Supported โ NuGet 4.9.0 and above
CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION,CPACK_NUGET_<compName>_PACKAGE_LICENSE_EXPRESSIONโ added in version 3.20. a Software Package Data Exchange SPDX license identifier (spec lives athttps://spdx.org/licenses) such asMIT,BSD-3-Clause, orLGPL-3.0-or-later. If you've got a choice of licenses or something more complex, compound license expressions can be formed using boolean operators โ for exampleMIT OR BSD-3-Clause. See the SPDX specification (https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions) for guidance on forming those complex license expressions. It's giving lawyer but make it open source ๐.- If
CPACK_NUGET_PACKAGE_LICENSE_FILE_NAMEis specified,CPACK_NUGET_PACKAGE_LICENSE_EXPRESSIONis ignored. - Mandatory โ No
- Default โ None
- If
CPACK_NUGET_PACKAGE_ICONURL,CPACK_NUGET_<compName>_PACKAGE_ICONURLโ deprecated since version 3.20: use a local icon file (CPACK_NUGET_PACKAGE_ICON) instead. A URL for a 64x64 image with a transparency background, to use as the icon for the package in UI display.- Mandatory โ No
- Default โ None
CPACK_NUGET_PACKAGE_ICON,CPACK_NUGET_<compName>_PACKAGE_ICONโ added in version 3.20. the filename of a 64x64 image with a transparency background, to use as the icon for the package in UI display. Yes, 64x64, they're serious about it ๐.- Mandatory โ No
- Default โ None
- Supported โ NuGet 5.3.0 and above
CPACK_NUGET_PACKAGE_README,CPACK_NUGET_<compName>_PACKAGE_READMEโ added in version 3.30. the package path, relative to the root of the package, to a readme file. Supported file formats include only Markdown (*.md). No.txt, no.rst, don't even try it ๐.- Mandatory โ No
- Default โ None
- Supported โ NuGet 5.10.0 preview 2 and above
CPACK_NUGET_PACKAGE_REQUIRE_LICENSE_ACCEPTANCEโ when set to a true value, the user will be prompted to accept the license before installing the package. Consent era โจ.- Mandatory โ No
- Default โ None
CPACK_NUGET_PACKAGE_DESCRIPTION_SUMMARY,CPACK_NUGET_<compName>_PACKAGE_DESCRIPTION_SUMMARYโ deprecated since version 3.30: Summary is being deprecated. Use description (CPACK_NUGET_PACKAGE_DESCRIPTION) instead. A short description of the package for UI display. If it's omitted, a truncated version of the description gets used.- Mandatory โ No
- Default โ
CPACK_PACKAGE_DESCRIPTION_SUMMARY
CPACK_NUGET_PACKAGE_RELEASE_NOTES,CPACK_NUGET_<compName>_PACKAGE_RELEASE_NOTESโ a description of the changes made in this release of the package, often used in UI like the Updates tab of the Visual Studio Package Manager in place of the package description. So it's got range ๐ .- Mandatory โ No
- Default โ None
CPACK_NUGET_PACKAGE_COPYRIGHT,CPACK_NUGET_<compName>_PACKAGE_COPYRIGHTโ copyright details for the package.- Mandatory โ No
- Default โ None
CPACK_NUGET_PACKAGE_LANGUAGE,CPACK_NUGET_<compName>_PACKAGE_LANGUAGEโ added in version 3.20. locale specifier for the package โ for exampleen_CA.- Mandatory โ No
- Default โ None
CPACK_NUGET_PACKAGE_TAGS,CPACK_NUGET_<compName>_PACKAGE_TAGSโ a space-delimited list of tags and keywords that describe the package and help it get discovered through search and filtering. SEO era, honestly ๐ธ.- Mandatory โ No
- Default โ None
CPACK_NUGET_PACKAGE_REPOSITORY_URL,CPACK_NUGET_<compName>_REPOSITORY_URLโ added in version 3.30.
Repository metadata lets you map the *.nupkg to the repository that built it ๐
It should be a publicly available URL that can be invoked directly by a version control software. It should not be an HTML page, because this is meant for the computer, not for your eyeballs ๐
Mandatory No ๐
Default None
Supported NuGet 4.0 and above
CPACK_NUGET_PACKAGE_REPOSITORY_TYPE
CPACK_NUGET_<compName>_REPOSITORY_TYPE
Added in version 3.30.
A type of the VCS repository. When you're uploading a package to nuget.org (https://www.nuget.org), the type is limited to 100 characters โ so like, keep it short bestie โ๏ธ
Mandatory Yes, if repository URL has been specified ๐ lowkey important
Default None
Supported NuGet 4.0 and above
CPACK_NUGET_PACKAGE_REPOSITORY_BRANCH
CPACK_NUGET_<compName>_REPOSITORY_BRANCH
Added in version 3.30.
A VSC branch name to build the package ๐ฟ (and yes, the original really does say "VSC" โ I'm not touching it, it's canon ๐)
Mandatory No
Default None
Supported NuGet 4.6 and above
CPACK_NUGET_PACKAGE_REPOSITORY_COMMIT
CPACK_NUGET_<compName>_REPOSITORY_COMMIT
Added in version 3.30.
A SHA-1 hash of the commit to build the package ๐
Mandatory No
Default None
Supported NuGet 4.6 and above
CPACK_NUGET_PACKAGE_TITLE
CPACK_NUGET_<compName>_PACKAGE_TITLE
A human-friendly title of the package โ the kind of thing that shows up in UI displays, like on nuget.org (https://www.nuget.org) and in the Package Manager in Visual Studio โจ If you don't specify it, the package ID is used. Slay by default, honestly.
Mandatory No
Default
CPACK_COMPONENT_<compName>_DISPLAY_NAME(seevariable:CPACK_COMPONENT_<compName>_DISPLAY_NAME)CPACK_COMPONENT_GROUP_<groupName>_DISPLAY_NAME
Dependencies specification ๐
CPACK_NUGET_PACKAGE_DEPENDENCIES
CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES
A list of default (not framework-specific) package dependencies ๐ฆ
Mandatory No
Default None
CPACK_NUGET_PACKAGE_DEPENDENCIES_<dependency>_VERSION
CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<dependency>_VERSION
A version specification (https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges) for the particular dependency, where <dependency> is an item of the dependency list (see above) ๐ฏ
Mandatory No
Default None
CPACK_NUGET_PACKAGE_TFMS
CPACK_NUGET_<compName>_PACKAGE_TFMS
Added in version 3.30.
A list of Target Framework Monikers (TFMs) for the package, e.g. "net47;netcoreapp21" ๐ For each of these TFMs a dependency group (https://learn.microsoft.com/en-us/nuget/reference/nuspec#dependency-groups) will be generated in the dependencies block of the NuGet package. Framework-specific dependencies can be added to these groups with the TFM dependency lists (see below).
This variable is particularly useful for fixing warnings NU5128 (https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5128) โ like, it's the whole reason it exists ๐ซถ
Mandatory No
Default None
CPACK_NUGET_PACKAGE_DEPENDENCIES_<tfm>
CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<tfm>
Added in version 3.30.
A list of package dependencies that apply specifically to the <tfm> framework, where <tfm> is an item from the TFMs list (see above) ๐
Mandatory No
Default None
CPACK_NUGET_PACKAGE_DEPENDENCIES_<tfm>_<dependency>_VERSION
CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<tfm>_<dependency>_VERSION
Added in version 3.30.
A version specification (https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges) for the particular framework-specific dependency, where <dependency> is an item of the <tfm>-specific dependency list (see above) ๐
Mandatory No
Default None
Example usage ๐
set(CPACK_GENERATOR NuGet)
# Set up package metadata
set(CPACK_PACKAGE_NAME SamplePackage)
set(CPACK_PACKAGE_VERSION "1.0.0")
set(CPACK_PACKAGE_VENDOR "Example Inc")
set(CPACK_NUGET_PACKAGE_AUTHORS "ExampleInc")
set(CPACK_PACKAGE_DESCRIPTION "A .NET wrapper around the foobar library for frobbling bratchens")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.example.com")
set(CPACK_NUGET_PACKAGE_REPOSITORY_URL "https://github.com/example/libfoobar.git")
set(CPACK_NUGET_PACKAGE_REPOSITORY_TYPE git)
set(CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION "MIT")
# Set up dependencies
set(CPACK_NUGET_PACKAGE_TFMS "net4;net6.0")
set(CPACK_NUGET_PACKAGE_DEPENDENCIES_net4 "Foo;Bar")
# NB: If a version number is omitted, the dependency will not be created
set(CPACK_NUGET_PACKAGE_DEPENDENCIES_net4_Foo_VERSION "1.23")
set(CPACK_NUGET_PACKAGE_DEPENDENCIES_net4_Bar_VERSION "4.3.2")
# NB: General dependencies (not framework-specific) go in this variable
set(CPACK_NUGET_PACKAGE_DEPENDENCIES "Baz")
set(CPACK_NUGET_PACKAGE_DEPENDENCIES_Baz_VERSION "9.8.6")
# NB: Since "net6.0" was listed but no dependencies have been specified, an empty group
# will be added to the nuspec file for this framework. This can be used to address warning NU5128.
include(CPack)
CPack PackageMaker Generator ๐
Removed. This once generated PackageMaker installers, but the generator has been removed since CMake 3.24 ๐ญ Xcode no longer distributes the PackageMaker tools. Use the CPack productbuild Generator (see cpack_gen:CPack productbuild Generator) instead โ it's the glow-up, fr fr.
CPack productbuild Generator ๐
Added in version 3.7.
productbuild CPack generator (macOS) โ the main character of macOS packaging โจ
Variables specific to CPack productbuild generator
The following variable is specific to installers built on Mac macOS using ProductBuild ๐ง
CPACK_COMMAND_PRODUCTBUILD
Path to the productbuild(1) command used to generate a product archive for the macOS Installer or Mac App Store ๐๏ธ This variable can be used to override the automatically detected command (or specify its location if the auto-detection fails to find it).
CPACK_PRODUCTBUILD_IDENTIFIER
Added in version 3.23.
Set the unique (non-localized) product identifier to be associated with the product (i.e., com.kitware.cmake) ๐ Any component product names will be appended to this value.
CPACK_PRODUCTBUILD_IDENTITY_NAME
Added in version 3.8.
Adds a digital signature to the resulting package โ๏ธ
CPACK_PRODUCTBUILD_KEYCHAIN_PATH
Added in version 3.8.
Specify a specific keychain to search for the signing identity ๐
CPACK_COMMAND_PKGBUILD
Path to the pkgbuild(1) command used to generate an macOS component package on macOS ๐งฐ This variable can be used to override the automatically detected command (or specify its location if the auto-detection fails to find it).
CPACK_PKGBUILD_IDENTITY_NAME
Added in version 3.8.
Adds a digital signature to the resulting package โ๏ธ (yes, this one's for pkgbuild, keep up bestie ๐)
CPACK_PKGBUILD_KEYCHAIN_PATH
Added in version 3.8.
Specify a specific keychain to search for the signing identity ๐
CPACK_PREFLIGHT_<COMP>_SCRIPT
Full path to a file that will be used as the preinstall script for the named <COMP> component's package, where <COMP> is the uppercased component name ๐ฌ No preinstall script is added if this variable is not defined for a given component โ so it's opt-in only, no surprise scripts.
CPACK_POSTFLIGHT_<COMP>_SCRIPT
Full path to a file that will be used as the postinstall script for the named <COMP> component's package, where <COMP> is the uppercased component name ๐ฌ No postinstall script is added if this variable is not defined for a given component.
CPACK_PRODUCTBUILD_RESOURCES_DIR
Added in version 3.9.
If specified, the productbuild generator copies files from this directory (including subdirectories) to the Resources directory ๐ This is done before the CPACK_RESOURCE_FILE_WELCOME (see variable:CPACK_RESOURCE_FILE_WELCOME), CPACK_RESOURCE_FILE_README (see variable:CPACK_RESOURCE_FILE_README), and CPACK_RESOURCE_FILE_LICENSE (see variable:CPACK_RESOURCE_FILE_LICENSE) files are copied. Order matters, iykyk ๐
CPACK_PRODUCTBUILD_DOMAINS
Added in version 3.23.
This option enables more granular control over where the product may be installed ๐บ๏ธ When it is set to true (see policy CMP0161, <#policy:CMP0161>), a domains element of the following form will be added to the productbuild Distribution XML:
<domains enable_anywhere="true" enable_currentUserHome="false" enable_localSystem="true"/>
The default values are as shown above, but can be overridden with CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE, CPACK_PRODUCTBUILD_DOMAINS_USER, and CPACK_PRODUCTBUILD_DOMAINS_ROOT ๐๏ธ
CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE
Added in version 3.23.
May be used to override the enable_anywhere attribute in the domains element of the Distribution XML ๐ When set to true, the product can be installed at the root of any volume, including non-system volumes.
Heads up bestie:CPACK_PRODUCTBUILD_DOMAINSmust be set totruefor this variable to have any effect. Otherwise it's just gonna sit there doing nothing ๐
CPACK_PRODUCTBUILD_DOMAINS_USER
Added in version 3.23.
May be used to override the enable_currentUserHome attribute in the domains element of the Distribution XML ๐ When set to true, the product can be installed into the current user's home directory. Note that when installing into the user's home directory, the following additional requirements will apply:
- The installer may not write outside the user's home directory ๐ซ
- The install will be performed as the current user rather than as
root. This may have ramifications forCPACK_PREFLIGHT_<COMP>_SCRIPTandCPACK_POSTFLIGHT_<COMP>_SCRIPTโ ๏ธ - Administrative privileges will not be needed to perform the install ๐
Again:CPACK_PRODUCTBUILD_DOMAINSmust be set totruefor this variable to have any effect. No cap ๐
CPACK_PRODUCTBUILD_DOMAINS_ROOTโ added in version 3.23. This one's here to override theenable_localSystemattribute inside thedomainselement of the Distribution XML. Set it totrueand the product can be installed in the root directory. Bestie, you normally want this set totrueunless the product should only be installed into the user's home directory. ๐
Heads up:CPACK_PRODUCTBUILD_DOMAINSmust be set totruefor this variable to have any effect at all. No domains, no root, periodt. ๐
๐จ Background Image
Added in version 3.17.
This whole little group of variables controls the background image of the generated installer โ yes, the aesthetic matters, this is the main character of your .pkg โจ
CPACK_PRODUCTBUILD_BACKGROUNDโ adds a background to the Distribution XML if you specify it. The value holds the path to the image in theResourcesdirectory. ๐ผ๏ธCPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENTโ adds analignmentattribute to the background in the Distribution XML. Peep Apple's docs for the valid values, iykyk. ๐CPACK_PRODUCTBUILD_BACKGROUND_SCALINGโ adds ascalingattribute to the background in the Distribution XML. Again, valid values live in Apple's documentation. ๐CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPEโ adds amime-typeattribute to the background in the Distribution XML. The option contains the MIME type of the image. ๐ท๏ธCPACK_PRODUCTBUILD_BACKGROUND_UTIโ adds anutiattribute to the background in the Distribution XML. The option contains the UTI type of the image. ๐CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUAโ adds a background for the Dark Aqua theme to the Distribution XML if specified. The value contains the path to the image in theResourcesdirectory. ๐CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_ALIGNMENTโ does the same asCPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT, but for the dark theme. ๐CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_SCALINGโ does the same asCPACK_PRODUCTBUILD_BACKGROUND_SCALING, but for the dark theme. ๐CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_MIME_TYPEโ does the same asCPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE, but for the dark theme. ๐CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_UTIโ does the same asCPACK_PRODUCTBUILD_BACKGROUND_UTI, but for the dark theme. ๐
๐ Distribution XML Template
CPack uses a template file to generate the distribution.dist file that this package generator uses internally. Normally CMake hands you the template file, but projects can totally supply their own โ just drop a file named CPack.distribution.dist.in into one of the directories listed in the CMAKE_MODULE_PATH variable and CPack will pick up your template instead of using its own. ๐ซถ
The distribution.dist file gets generated by doing substitutions similar to what the configure_file() command does. Any variable that's set when CPack runs is available for substitution using the usual @...@ form. The following variables are also set internally and made available for substitution:
CPACK_RESOURCE_FILE_LICENSE_NOPATHโ same asCPACK_RESOURCE_FILE_LICENSEexcept without the path. The named file will be available in the same directory as the generateddistribution.distfile. ๐CPACK_RESOURCE_FILE_README_NOPATHโ same asCPACK_RESOURCE_FILE_READMEexcept without the path. The named file will be available in the same directory as the generateddistribution.distfile. ๐CPACK_RESOURCE_FILE_WELCOME_NOPATHโ same asCPACK_RESOURCE_FILE_WELCOMEexcept without the path. The named file will be available in the same directory as the generateddistribution.distfile. ๐CPACK_APPLE_PKG_INSTALLER_CONTENTโ added in version 3.23. This one contains all the XML elements that specify installer-wide options (including domain details), default backgrounds and the choices outline. ๐CPACK_PACKAGEMAKER_CHOICESโ deprecated since version 3.23 ๐. This contains only the XML elements that specify the default backgrounds and the choices outline. It does not include the installer-wide options or any domain details. UseCPACK_APPLE_PKG_INSTALLER_CONTENTinstead. Like, please, it's right there.
๐ฆ CPack RPM Generator
The built in (binary) CPack RPM generator (Unix only, bestie โ Unix only). ๐ง
๐ ๏ธ Variables specific to CPack RPM generator
The CPack RPM generator may be used to create RPM packages using CPack. The CPack RPM generator is a CPack generator, thus it uses the CPACK_XXX variables used by CPack. ๐
The CPack RPM generator has specific features which are controlled by the specifics CPACK_RPM_XXX variables.
CPACK_RPM_<COMPONENT>_XXXX variables may be used in order to have component-specific values. Note however that <COMPONENT> refers to the grouping name written in upper case. It may be either a component name or a component GROUP name. Usually those variables correspond to RPM spec file entities. One may find information about spec files here: https://rpm.org/documentation. ๐
Changed in version 3.6: the <COMPONENT> part of variables is preferred to be in upper case (e.g. if the component is named foo then use the CPACK_RPM_FOO_XXXX variable name format) as is with other CPACK_<COMPONENT>_XXXX variables. For the purposes of back compatibility (CMake/CPack version 3.5 and lower) support for same-cased component (e.g. fOo would be used as CPACK_RPM_fOo_XXXX) is still supported for variables defined in older versions of CMake/CPack but is not guaranteed for variables that will be added in the future. For the sake of back compatibility, same-cased component variables also override upper-cased versions where both are present. โ ๏ธ
Here are some CPack RPM generator wiki resources that are here for historic reasons and are no longer maintained but may still prove useful โ like a vintage find at the thrift store, no cap:
https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configurationhttps://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#rpm-unix-only
List of CPack RPM generator specific variables:
CPACK_RPM_COMPONENT_INSTALLโ enable component packaging for the CPack RPM generator.- Mandatory: No
- Default:
OFF - If enabled (
ON) multiple packages are generated. By default a single package containing files of all components is generated. ๐
CPACK_RPM_PACKAGE_SUMMARY,CPACK_RPM_<component>_PACKAGE_SUMMARYโ the RPM package summary.- Mandatory: Yes
- Default:
CPACK_PACKAGE_DESCRIPTION_SUMMARY - Added in version 3.2: per-component
CPACK_RPM_<component>_PACKAGE_SUMMARYvariables. โจ
CPACK_RPM_PACKAGE_NAME,CPACK_RPM_<component>_PACKAGE_NAMEโ the RPM package name.- Mandatory: Yes
- Default:
CPACK_PACKAGE_NAME - Added in version 3.5: per-component
CPACK_RPM_<component>_PACKAGE_NAMEvariables. โจ
CPACK_RPM_FILE_NAME,CPACK_RPM_<component>_FILE_NAMEโ added in version 3.6. Package file name.- Mandatory: Yes
- Default:
<CPACK_PACKAGE_FILE_NAME>[-<component>].rpmwith spaces replaced by- - This may be set to:
RPM-DEFAULTโ tellrpmbuildto automatically generate the package file name. ๐ค<file-name>[.rpm]โ use the given file name.- Changed in version 3.29: the
.rpmsuffix will be automatically added if missing. Previously the suffix was required. ๐
- Changed in version 3.29: the
Note: by using a user-provided spec file, rpm macro extensions such as for generating debuginfo packages, or by simply using multiple components, more than one rpm file may be generated โ either from a single spec file or from multiple spec files (each component execution produces its own spec file). In such cases duplicate file names may occur as a result of this variable setting or spec file content structure. Duplicate files get overwritten and it is up to the packager to set the variables in a manner that will prevent such errors. โ ๏ธ Like, please don't let that be you.
CPACK_RPM_MAIN_COMPONENTโ added in version 3.8. Main component that is packaged without component suffix.- Mandatory: No
- Default: (empty)
- This variable can be set to any component or group name so that the component or group rpm package is generated without a component suffix in the filename and package name. ๐
CPACK_RPM_PACKAGE_EPOCHโ added in version 3.10. The RPM package epoch.- Mandatory: No
- Default: (empty)
- Optional number that should be incremented when changing versioning schemas or fixing mistakes in the version numbers of older packages. ๐ข
CPACK_RPM_PACKAGE_VERSIONโ the RPM package version.- Mandatory: Yes
- Default:
CPACK_PACKAGE_VERSION
CPACK_RPM_PACKAGE_ARCHITECTURE,CPACK_RPM_<component>_PACKAGE_ARCHITECTUREโ the RPM package architecture.- Mandatory: Yes
- Default: native architecture output by
uname -m - This may be set to
noarchif you know you are building anoarchpackage. ๐ฆ - Added in version 3.3: per-component
CPACK_RPM_<component>_PACKAGE_ARCHITECTUREvariables.
CPACK_RPM_PACKAGE_RELEASEโ the RPM package release.- Mandatory: Yes
- Default:
1 - This is the numbering of the RPM package itself, i.e. the version of the packaging and not the version of the content (see
CPACK_RPM_PACKAGE_VERSION). One may change the default value if the previous packaging was buggy and/or you want to put a fancy Linux distro specific numbering here. ๐
Note: this is the string that goes into the RPMRelease:field. Some distros (e.g. Fedora, CentOS) require1%{?dist}format and not just a number. The%{?dist}part can be added by settingCPACK_RPM_PACKAGE_RELEASE_DIST. ๐
CPACK_RPM_PACKAGE_RELEASE_DISTโ added in version 3.6. The dist tag that is added to the RPMRelease:field. ๐ท๏ธ
CPACK_RPM_PACKAGE_RELEASE_DIST</p> (the %{dist} one ๐)
Mandatory โ No
Default โ OFF
okay so this one is literally just the reported %{dist} tag from the current distribution, or an empty %{dist} if the RPM macro isn't set. And if you do set this variable, the RPM Release: field value gets set to:
${CPACK_RPM_PACKAGE_RELEASE}%{?dist}
slay, that's it, that's the whole vibe ๐
CPACK_RPM_PACKAGE_LICENSE</p>
The RPM package license policy. yes bestie, the legal bit ๐
Mandatory โ Yes
Default โ "unknown"
CPACK_RPM_PACKAGE_GROUP</p>
CPACK_RPM_<component>_PACKAGE_GROUP</p>
The RPM package group. grouping is self-care fr fr ๐
Mandatory โ Yes
Default โ "unknown"
Added in version 3.5: Per-component CPACK_RPM_<component>_PACKAGE_GROUP variables. so you can group per-component too, iconic โจ
CPACK_RPM_PACKAGE_VENDOR</p>
The RPM package vendor. who's shipping this masterpiece ๐ฅ
Mandatory โ Yes
Default โ CPACK_PACKAGE_VENDOR if set, or "unknown"
CPACK_RPM_PACKAGE_URL</p>
CPACK_RPM_<component>_PACKAGE_URL</p>
The project's URL. drop the link bestie ๐
Mandatory โ No
Default โ CMAKE_PROJECT_HOMEPAGE_URL
Added in version 3.12: The CMAKE_PROJECT_HOMEPAGE_URL variable. she's new, she's cute ๐ฆ
CPACK_RPM_PACKAGE_DESCRIPTION</p>
CPACK_RPM_<component>_PACKAGE_DESCRIPTION</p>
RPM package description. tell them what it is ๐
Mandatory โ Yes
Default โ literally a priority list, in this exact order:
CPACK_COMPONENT_<compName>_DESCRIPTION(component based installers only) if set,CPACK_PACKAGE_DESCRIPTION_FILEif set, or- no package description available
Added in version 3.2: Per-component CPACK_RPM_<component>_PACKAGE_DESCRIPTION variables. per-component desc, we love to see it ๐ธ
CPACK_RPM_COMPRESSION_TYPE</p>
RPM compression type. the way your package gets squished ๐ซถ
Mandatory โ No
Default โ (system default)
May be used to override the RPM compression type used to build the RPM. For example some Linux distributions default to xz or zstd. Using this, one can specify a specific compression type to be used.
Possible values are:
lzmaโ Lempel-Ziv-Markov chain algorithmxzโ XZ Utils LZMA2 (Lempel-Ziv-Markov chain algorithm, version 2) compressionbzip2โ bzip2 Burrows-Wheeler algorithmgzipโ GNU Gzip Deflate compressionzstdโ Added in version 3.31. Zstandard compression
pick your fighter, they're all valid ๐
CPACK_RPM_PACKAGE_AUTOREQ</p>
CPACK_RPM_<component>_PACKAGE_AUTOREQ</p>
RPM spec autoreq field.
Mandatory โ No
Default โ (empty, no default value)
May be used to enable (1, yes) or disable (0, no) automatic shared libraries dependency detection. Dependencies are added to the requires list.
Note: By default automatic dependency detection is enabled by rpm generator. so if you don't touch it, it's already on, no cap ๐ฅ
CPACK_RPM_PACKAGE_AUTOPROV</p>
CPACK_RPM_<component>_PACKAGE_AUTOPROV</p>
RPM spec autoprov field.
Mandatory โ No
Default โ (empty, no default value)
May be used to enable (1, yes) or disable (0, no) automatic listing of shared libraries that are provided by the package. Shared libraries are added to the provides list.
Note: By default automatic provides detection is enabled by rpm generator. again, already slaying on its own ๐
CPACK_RPM_PACKAGE_AUTOREQPROV</p>
CPACK_RPM_<component>_PACKAGE_AUTOREQPROV</p>
RPM spec autoreqprov field.
Mandatory โ No
Default โ (empty, no default value)
Variable enables/disables autoreq and autoprov at the same time. See CPACK_RPM_PACKAGE_AUTOREQ and CPACK_RPM_PACKAGE_AUTOPROV for more details. two birds, one variable, efficiency queen ๐
Note: By default automatic detection feature is enabled by rpm. periodt.
CPACK_RPM_PACKAGE_REQUIRES</p>
CPACK_RPM_<component>_PACKAGE_REQUIRES</p>
RPM spec requires field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set RPM dependencies (requires). Note that you must enclose the entire value between quotes when setting this variable, for example:
set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
The required package list of an RPM file could be printed with:
rpm -qp --requires file.rpm
quote the whole thing or it will not work, i don't make the rules ๐ญ
CPACK_RPM_PACKAGE_CONFLICTS</p>
CPACK_RPM_<component>_PACKAGE_CONFLICTS</p>
RPM spec conflicts field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set negative RPM dependencies (conflicts). Note that you must enclose the entire value between quotes when setting this variable, for example:
set(CPACK_RPM_PACKAGE_CONFLICTS "libxml2")
The conflicting package list of an RPM file could be printed with:
rpm -qp --conflicts file.rpm
drama between packages, honestly ๐
CPACK_RPM_PACKAGE_REQUIRES_PRE</p>
CPACK_RPM_<component>_PACKAGE_REQUIRES_PRE</p>
Added in version 3.2.
RPM spec requires(pre) field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set RPM preinstall dependencies (requires(pre)). Note that you must enclose the entire value between quotes when setting this variable, for example:
set(CPACK_RPM_PACKAGE_REQUIRES_PRE "shadow-utils, initscripts")
needs it before the install, main character energy ๐
CPACK_RPM_PACKAGE_REQUIRES_POST</p>
CPACK_RPM_<component>_PACKAGE_REQUIRES_POST</p>
Added in version 3.2.
RPM spec requires(post) field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set RPM postinstall dependencies (requires(post)). Note that you must enclose the entire value between quotes when setting this variable, for example:
set(CPACK_RPM_PACKAGE_REQUIRES_POST "shadow-utils, initscripts")
needs it after the install, lowkey clingy but valid โจ
CPACK_RPM_PACKAGE_REQUIRES_POSTUN</p>
CPACK_RPM_<component>_PACKAGE_REQUIRES_POSTUN</p>
Added in version 3.2.
RPM spec requires(postun) field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set RPM postuninstall dependencies (requires(postun)). Note that you must enclose the entire value between quotes when setting this variable, for example:
set(CPACK_RPM_PACKAGE_REQUIRES_POSTUN "shadow-utils, initscripts")
needed even on the way out, we love a loyal dependency ๐ซถ
CPACK_RPM_PACKAGE_REQUIRES_PREUN</p>
CPACK_RPM_<component>_PACKAGE_REQUIRES_PREUN</p>
Added in version 3.2.
RPM spec requires(preun) field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set RPM preuninstall dependencies (requires(preun)). Note that you must enclose the entire value between quotes when setting this variable, for example:
set(CPACK_RPM_PACKAGE_REQUIRES_PREUN "shadow-utils, initscripts")
last one of the four, and she ate ๐ธ
CPACK_RPM_PACKAGE_SUGGESTS</p>
CPACK_RPM_<component>_PACKAGE_SUGGESTS</p>
RPM spec suggests field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set weak RPM dependencies (suggests). If rpmbuild doesn't support the Suggests tag, CPack will emit a warning and ignore this variable. Note that you must enclose the entire value between quotes when setting this variable.
not a demand, just a suggestion bestie ๐ and if rpmbuild can't handle it, warning + ignored, no drama
CPACK_RPM_PACKAGE_RECOMMENDS</p>
CPACK_RPM_<component>_PACKAGE_RECOMMENDS</p>
Added in version 4.1.
RPM spec recommends field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set weak RPM dependencies (recommends). If rpmbuild doesn't support the Recommends tag, CPack will emit a warning and ignore this variable. Note that you must enclose the entire value between quotes when setting this variable.
a little stronger than a suggestion, still chill ๐
CPACK_RPM_PACKAGE_SUPPLEMENTS</p>
CPACK_RPM_<component>_PACKAGE_SUPPLEMENTS</p>
Added in version 4.1.
RPM spec supplements field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set weak RPM dependencies (supplements). If rpmbuild doesn't support the Supplements tag, CPack will emit a warning and ignore this variable. Note that you must enclose the entire value between quotes when setting this variable.
reverse-flavored weak dep, it's giving "this package enriches that one" ๐ฆ
CPACK_RPM_PACKAGE_ENHANCES</p>
CPACK_RPM_<component>_PACKAGE_ENHANCES</p>
Added in version 4.1.
RPM spec enhances field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set weak RPM dependencies (enhances). If rpmbuild doesn't support the Enhances tag, CPack will emit a warning and ignore this variable. Note that you must enclose the entire value between quotes when setting this variable.
the fourth and final weak dep, all added in 4.1 like a little squad ๐ฅ
CPACK_RPM_PACKAGE_PROVIDES</p>
CPACK_RPM_<component>_PACKAGE_PROVIDES</p>
RPM spec provides field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set RPM dependencies (provides). The provided package list of an RPM file could be printed with:
rpm -qp --provides file.rpm
this is the "what do i actually give you" list, be generous ๐
CPACK_RPM_PACKAGE_OBSOLETES</p>
CPACK_RPM_<component>_PACKAGE_OBSOLETES</p>
RPM spec obsoletes field.
Mandatory โ No
Default โ (empty, no default value)
May be used to set RPM packages that are obsoleted by this one. out with the old, in with the new, no hard feelings ๐โจ
CPACK_RPM_PACKAGE_RELOCATABLE</p>
build a relocatable RPM. she can move wherever she wants ๐ง
Mandatory โ No
Default โ CPACK_PACKAGE_RELOCATABLE
If this variable is set to TRUE or ON, the CPack RPM generator will try to build a relocatable RPM package. A relocatable RPM may be installed using:
rpm --prefix or --relocate
in order to install it at an alternate place, see rpm(8).
careful bestie ๐ญ โ note that currently this may fail ifCPACK_SET_DESTDIRis set toON. IfCPACK_SET_DESTDIRis set then you will get a warning message, but if there is a file installed with an absolute path you'll get unexpected behavior. no cap, that's the actual warning, read it twice.
CPACK_RPM_SPEC_INSTALL_POST</p>
Deprecated since version 2.8.12: Use CPACK_RPM_SPEC_MORE_DEFINE instead.
Mandatory โ No
Default โ (empty, no default value)
it's giving "old news, use the other one" ๐ the deprecation is real and this variable knows it.
carry on, bestie โ we're still deep in RPM land and honestly it's giving โจ very detailed โจ but every single line matters, so let's go ๐
CPACK_RPM_SPEC_INSTALL_POST(the continuation above) โ may be used to override the__spec_install_postsection within the generated spec file. This affects the install step during package creation, not during package installation. For adding operations to be performed during package installation, useCPACK_RPM_POST_INSTALL_SCRIPT_FILEinstead. ๐ซถ
CPACK_RPM_SPEC_MORE_DEFINE</p>
RPM extended spec definitions lines.
Mandatory
No.
Default
(empty โ you set it, girl ๐ )
May be used to add any %define lines to the generated spec file. An example of its use is to prevent stripping of executables โ but note that this may also disable other default post install processing ๐:
set(CPACK_RPM_SPEC_MORE_DEFINE "%define __spec_install_post /bin/true")
Added in version 4.4: If the variable is a list, its string elements will be concatenated using \n before being substituted into the spec template. Slay, list support ๐
CPACK_RPM_PACKAGE_DEBUG</p>
Toggle CPack RPM generator debug output.
Mandatory
No.
Default
(empty)
May be set when invoking cpack in order to trace debug information during the CPack RPM run. For example you may launch CPack like this:
cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
CPACK_RPM_USER_BINARY_SPECFILE</p>
CPACK_RPM_<componentName>_USER_BINARY_SPECFILE</p>
A user provided spec file.
Mandatory
No.
Default
(empty)
May be set by the user in order to specify a USER binary spec file to be used by the CPack RPM generator instead of generating the file. The specified file will be processed by configure_file(@ONLY). ๐
CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE</p>
Spec file template.
Mandatory
No.
Default
(empty)
If set, CPack will generate a template for a USER specified binary spec file and stop with an error ๐. For example launch CPack like this:
cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
The user may then use this file in order to hand-craft is own binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE. (Yes, the original page says "is own" โ I'm not fixing the manpage's typos, I'm just the messenger ๐ซถ)
CPACK_RPM_PRE_INSTALL_SCRIPT_FILE</p>
CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE</p>
CPACK_RPM_PRE_TRANS_SCRIPT_FILE</p>
Path to file containing pre install/uninstall/transaction script.
Mandatory
No.
Default
(empty)
May be used to embed a pre installation/uninstallation/transaction script in the spec file. The referred script file (or both) will be read and directly put after the %pre or %preun section. If CPACK_RPM_COMPONENT_INSTALL is set to ON the install/uninstall/transaction script for each component can be overridden with CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE, CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE, and CPACK_RPM_<COMPONENT>_PRE_TRANS_SCRIPT_FILE. One may verify which scriptlet has been included with:
rpm -qp --scripts package.rpm
Added in version 3.18: The CPACK_RPM_PRE_TRANS_SCRIPT_FILE variable. โจ
CPACK_RPM_POST_INSTALL_SCRIPT_FILE</p>
CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE</p>
CPACK_RPM_POST_TRANS_SCRIPT_FILE</p>
Path to file containing post install/uninstall/transaction script.
Mandatory
No.
Default
(empty)
May be used to embed a post installation/uninstallation/transaction script in the spec file. The referred script file (or both) will be read and directly put after the %post or %postun section. If CPACK_RPM_COMPONENT_INSTALL is set to ON the install/uninstall/transaction script for each component can be overridden with CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE, CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE, and CPACK_RPM_<COMPONENT>_POST_TRANS_SCRIPT_FILE. One may verify which scriptlet has been included with:
rpm -qp --scripts package.rpm
Added in version 3.18: The CPACK_RPM_POST_TRANS_SCRIPT_FILE variable. ๐
CPACK_RPM_USER_FILELIST</p>
CPACK_RPM_<COMPONENT>_USER_FILELIST</p>
Mandatory
No.
Default
(empty)
May be used to explicitly specify %(<directive>) file line in the spec file. Like %config(noreplace) or any other directive that be found in the %files section. Since the CPack RPM generator is generating the list of files (and directories) the user specified files of the CPACK_RPM_<COMPONENT>_USER_FILELIST list will be removed from the generated list. If referring to directories do not add a trailing slash. ๐ซ
Added in version 3.8: You can have multiple directives per line, as in %attr(600,root,root) %config(noreplace). Periodt. ๐
CPACK_RPM_CHANGELOG_FILE</p>
RPM changelog file.
Mandatory
No.
Default
(empty)
May be used to embed a changelog in the spec file. The referred file will be read and directly put after the %changelog section. ๐
CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST</p>
List of paths to be excluded.
Mandatory
No.
Default
The following paths are excluded by default:
/etc/etc/init.d/usr/usr/bin/usr/include/usr/lib/usr/libx32/usr/lib64/usr/share/usr/share/aclocal/usr/share/doc
May be used to exclude path (directories or files) from the auto-generated list of paths discovered by CPack RPM. The default value contains a reasonable set of values if the variable is not defined by the user. If the variable is defined by the user then the CPack RPM generator will NOT any of the default path (that's the manpage's wording, not mine, bestie ๐ญ). If you want to add some path to the default list then you can use the CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION variable.
Added in version 3.10: Added /usr/share/aclocal to the default list of excludes. ๐ธ
CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION</p>
Additional list of paths to be excluded.
Mandatory
No.
Default
(empty)
May be used to add more exclude path (directories or files) from the initial default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST. ๐ฆ
CPACK_RPM_RELOCATION_PATHS</p>
Added in version 3.2.
Packages relocation paths list.
Mandatory
No.
Default
(empty)
May be used to specify more than one relocation path per relocatable RPM. Variable contains a list of relocation paths that if relative are prefixed by the value of CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX or by the value of CPACK_PACKAGING_INSTALL_PREFIX if the component version is not provided. Variable is not component based, as its content can be used to set a different path prefix for e.g. binary dir and documentation dir at the same time. Only prefixes that are required by a certain component are added to that component โ component must contain at least one file/directory/symbolic link with CPACK_RPM_RELOCATION_PATHS prefix for a certain relocation path to be added. Package will not contain any relocation paths if there are no files/directories/symbolic links on any of the provided prefix locations. Packages that either do not contain any relocation paths or contain files/directories/symbolic links that are outside relocation paths print out an AUTHOR_WARNING that RPM will be partially relocatable. โ ๏ธ
CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX</p>
Added in version 3.2.
Per component relocation path install prefix.
Mandatory
No.
Default
CPACK_PACKAGING_INSTALL_PREFIX
May be used to set per component CPACK_PACKAGING_INSTALL_PREFIX for relocatable RPM packages. ๐ฏ
CPACK_RPM_NO_INSTALL_PREFIX_RELOCATION</p>
CPACK_RPM_NO_<COMPONENT>_INSTALL_PREFIX_RELOCATION</p>
Added in version 3.3.
Removal of default install prefix from relocation paths list.
Mandatory
No.
Default
CPACK_PACKAGING_INSTALL_PREFIX or CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX are treated as one of relocation paths.
May be used to remove CPACK_PACKAGING_INSTALL_PREFIX and CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX from relocatable RPM prefix paths. ๐ง
CPACK_RPM_ADDITIONAL_MAN_DIRS</p>
Added in version 3.3.
Mandatory
No.
Default
Regular expressions that are added by default were taken from the brp-compress RPM macro:
/usr/man/man.*/usr/man/.*/man.*/usr/info.*/usr/share/man/man.*/usr/share/man/.*/man.*/usr/share/info.*/usr/kerberos/man.*/usr/X11R6/man/man.*/usr/lib/perl5/man/man.*/usr/share/doc/.*/man/man.*/usr/lib/.*/man/man.*
May be used to set additional man dirs that could potentially be compressed by the brp-compress RPM macro. Variable content must be a list of regular expressions that point to directories containing man files or to man files directly. Note that in order to compress man pages a path must also be present in the brp-compress RPM script and that the brp-compress script must be added to RPM configuration by the operating system. ๐
CPACK_RPM_DEFAULT_USER</p>
CPACK_RPM_<compName>_DEFAULT_USER</p>
Added in version 3.6.
Default user ownership of RPM content.
Mandatory
No.
Default
root
Value should be the user name and not the UID, bestie ๐ญ like please do not put numbers there. And <compName> has to be in UPPER-CASE ๐
.
CPACK_RPM_DEFAULT_GROUPCPACK_RPM_<compName>_DEFAULT_GROUPโ Added in version 3.6.
okay so this one is the default group ownership of your RPM content ๐
- Mandatory โ No ๐
- Default โ
root๐
Value should be the group name, not the GID โ same deal as above, no numbers. And yeah, <compName> must be in upper-case.
CPACK_RPM_DEFAULT_FILE_PERMISSIONSCPACK_RPM_<compName>_DEFAULT_FILE_PERMISSIONSโ Added in version 3.6.
the default permissions used for packaged files ๐
- Mandatory โ No
- Default โ (system default) ๐ฑ
Accepted values are lists with PERMISSIONS. Valid permissions are literally these and only these:
OWNER_READOWNER_WRITEOWNER_EXECUTEGROUP_READGROUP_WRITEGROUP_EXECUTEWORLD_READWORLD_WRITEWORLD_EXECUTE
And <compName> must be in upper-case, periodt.
CPACK_RPM_DEFAULT_DIR_PERMISSIONSCPACK_RPM_<compName>_DEFAULT_DIR_PERMISSIONSโ Added in version 3.6.
the default permissions used for packaged directories ๐ (yes it's a separate variable from files, don't @ me)
- Mandatory โ No
- Default โ (system default) ๐ฑ
Accepted values are lists with PERMISSIONS, and the valid permissions are the same as for CPACK_RPM_DEFAULT_FILE_PERMISSIONS. Again: <compName> in upper-case, bestie ๐
.
CPACK_RPM_INSTALL_WITH_EXECโ Added in version 3.11.
force execute permissions on programs and shared libraries โก
- Mandatory โ No
- Default โ (system default)
This forces owner, group and world execute permissions onto programs and shared libraries. The whole reason it exists is so you can create valid rpm packages on systems like Debian where shared libraries don't have execute permissions set ๐ซถ iconic of them honestly.
Note: Programs and shared libraries without execute permissions are ignored during separation of debug symbols from the binary for debuginfo packages ๐ญ so keep that in mind.
๐ฆ Packaging of Symbolic Links ๐ฆ
Added in version 3.3.
The CPack RPM generator supports packaging of symbolic links, slay ๐๐
execute_process(COMMAND ${CMAKE_COMMAND}
-E create_symlink <relative_path_location> <symlink_name>)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/<symlink_name>
DESTINATION <symlink_location> COMPONENT libraries)
Symbolic links will be optimized (paths get shortened if possible) before being added to the package โ or, if multiple relocation paths are detected, a post install symlink relocation script gets generated โจ.
Symbolic links may point to locations that are not packaged by the same package (whether that's a different component or literally not packaged at all), but those locations will be treated as if they were a part of the package while determining whether the symlink should be created or present in a post install script โ depending on relocation paths, iykyk ๐ง
Changed in version 3.6: symbolic links that point to locations outside the packaging path produce a warning and get treated as non relocatable permanent symbolic links. Previous versions of CMake produced an error in this case ๐.
Currently there are a few limitations though:
- For component based packaging, component interdependency is not checked when processing symbolic links ๐ซ . Symbolic links pointing to content of a different component are treated the same way as if pointing to a location that will not be packaged.
- Symbolic links pointing to a location through one or more intermediate symbolic links will not be handled differently โ if the intermediate symlink(s) is also on a relocatable path, relocating it during package installation may cause the initial symbolic link to point to an invalid location ๐ญ.
๐ธ Packaging of debug information ๐ธ
Added in version 3.7.
Debuginfo packages contain debug symbols and sources for debugging packaged binaries ๐โจ
Debuginfo RPM packaging has its own set of variables, bestie:
CPACK_RPM_DEBUGINFO_PACKAGECPACK_RPM_<component>_DEBUGINFO_PACKAGE
Enable generation of debuginfo RPM package(s)</cornflower> ๐ฆ
- Mandatory โ No
- Default โ
OFF
Note: Binaries must contain debug symbols before packaging, so use eitherDebugorRelWithDebInfofor theCMAKE_BUILD_TYPE <#variable:CMAKE_BUILD_TYPE>variable value ๐ซถ
Additionally, ifCPACK_STRIP_FILES <#variable:CPACK_STRIP_FILES>is set, the files will be stripped before they even get to the RPM generator โ so they won't contain debug symbols and a debuginfo package will not get built. Do not use withCPACK_STRIP_FILES <#variable:CPACK_STRIP_FILES>๐
Note: Packages generated from packages without binary files, with binary files but without execute permissions, or without debug symbols will cause packaging termination ๐ญ like it just stops.
CPACK_BUILD_SOURCE_DIRS
Provides locations of root directories of source files from which binaries were built ๐๏ธ
- Mandatory โ Yes if
CPACK_RPM_DEBUGINFO_PACKAGEis set - Default โ
Note: For a CMake project,CPACK_BUILD_SOURCE_DIRSis set by default to point at theCMAKE_SOURCE_DIR <#variable:CMAKE_SOURCE_DIR>andCMAKE_BINARY_DIR <#variable:CMAKE_BINARY_DIR>paths ๐
Note: Sources with path prefixes that do not fall under any location provided with CPACK_BUILD_SOURCE_DIRS will not be present in the debuginfo package ๐
CPACK_RPM_BUILD_SOURCE_DIRS_PREFIXCPACK_RPM_<component>_BUILD_SOURCE_DIRS_PREFIX
Prefix of the location where sources will be placed during package installation ๐
- Mandatory โ Yes if
CPACK_RPM_DEBUGINFO_PACKAGEis set - Default โ
/usr/src/debug/${CPACK_PACKAGE_FILE_NAME}and, for component packaging,/usr/src/debug/${CPACK_PACKAGE_FILE_NAME}-<component>
Note: Each source path prefix is additionally suffixed bysrc_<index>where index is the index of the path used from theCPACK_BUILD_SOURCE_DIRSvariable ๐ฎโ๐จ. This produces the${CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX}/src_<index>replacement path. The limitation is that the replaced path part must be shorter or of equal length than the length of its replacement ๐ . If that's not the case, either setCPACK_RPM_BUILD_SOURCE_DIRS_PREFIXto a shorter path or place your source directories on a longer path ๐ซ
CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS
Directories containing sources that should be excluded from debuginfo packages ๐ซ
- Mandatory โ No
- Default โ
The following paths are excluded by default:
/usr/usr/src/usr/src/debug
Listed paths are owned by other RPM packages and should therefore not be deleted on debuginfo package uninstallation ๐ญ (please, they're not yours)
CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS_ADDITION
Paths that should be appended to CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS for exclusion โ
- Mandatory โ No
- Default โ
CPACK_RPM_DEBUGINFO_SINGLE_PACKAGEโ Added in version 3.8.
Create a single debuginfo package even if components packaging is set ๐โจ
- Mandatory โ No
- Default โ
OFF
When this variable is enabled it produces a single debuginfo package even if component packaging is enabled ๐
When using this feature in combination with components packaging and there is more than one component, this variable requires CPACK_RPM_MAIN_COMPONENT to be set ๐ซถ
Note: If none of theCPACK_RPM_<component>_DEBUGINFO_PACKAGEvariables is set, thenCPACK_RPM_DEBUGINFO_PACKAGEis automatically set toONwhenCPACK_RPM_DEBUGINFO_SINGLE_PACKAGEis set ๐
CPACK_RPM_DEBUGINFO_FILE_NAMECPACK_RPM_<component>_DEBUGINFO_FILE_NAMEโ Added in version 3.9.
Debuginfo package file name ๐ท๏ธ
- Mandatory โ No
- Default โ
rpmbuildtool generated package file name
If you provide an alternative debuginfo package file name it must end with the .rpm suffix and should differ from the file names of other generated packages ๐
The variable may contain the @cpack_component@ placeholder, which gets replaced by the component name if component packaging is enabled โ otherwise it deletes the placeholder ๐
Setting the variable to RPM-DEFAULT may be used to explicitly set filename generation to default โจ
Note:CPACK_RPM_FILE_NAMEalso supports therpmbuildtool generated package file name โ disabled by default, but it can be enabled by setting that variable toRPM-DEFAULT๐
๐ง Packaging of sources (SRPM) ๐ง
Added in version 3.7.
SRPM packaging is enabled by setting the CPACK_RPM_PACKAGE_SOURCES variable while usually using the CPACK_INSTALLED_DIRECTORIES <#variable:CPACK_INSTALLED_DIRECTORIES> variable to provide the directory containing CMakeLists.txt and source files ๐ซถ
For CMake projects an SRPM package would be produced by executing:
cpack -G RPM --config ./CPackSourceConfig.cmake
Note: The produced SRPM package is expected to be built with thecmake(1) <#manual:cmake(1)>executable and packaged with thecpack(1) <#manual:cpack(1)>executable โ soCMakeLists.txthas to be located in the root source directory and must be able to generate binary rpm packages by executing thecpack -G <#cmdoption-cpack-G>command ๐ฎโ๐จ. Both of those executables, plusrpmbuild, must also be present when generating binary rpm packages from the produced SRPM package ๐
Once the SRPM package is generated it can be used to generate binary packages by creating a directory structure for rpm generation and executing the rpmbuild tool:
mkdir -p build_dir/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
rpmbuild --define "_topdir <path_to_build_dir>" --rebuild <SRPM_file_name>
Generated packages will be located in the build_dir/RPMS directory or its sub directories ๐โจ
Note: SRPM packages internally use the CPack/RPM generator to generate binary packages, so CMakeScripts.txt can decide during the SRPM โ binary rpm generation step what content the package(s) should have, and also how they should be packaged (monolithic or components). CMake can figure this out by, like, reading environment variables that the package manager sets before it starts generating binary rpm packages. That way a single SRPM package can produce different binary rpm packages on different platforms, depending on that platform's packaging rules. ๐
Source RPM packaging has its own little set of variables, bestie:
CPACK_RPM_PACKAGE_SOURCESโ should the content be packaged as a source rpm? (default is binary rpm)- Mandatory: No
- Default:
OFF
Note: for cmake projects, theCPACK_RPM_PACKAGE_SOURCESvariable is set toOFFin the generatedCPackConfig.cmakefile, andONin the generatedCPackSourceConfig.cmakefile. ๐ซถ
CPACK_RPM_SOURCE_PKG_BUILD_PARAMSโ extra command-line parameters handed to thecmake(1)executable.- Mandatory: No
- Default: (empty)
CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIXโ the packaging install prefix that gets put into theCPACK_PACKAGING_INSTALL_PREFIXvariable when producing binary RPM packages.- Mandatory: Yes
- Default:
/
CPACK_RPM_BUILDREQUIRESโ list of source rpm build dependencies.- Mandatory: No
- Default: (empty)
- May be used to set source RPM build dependencies (
BuildRequires). Lowkey important: you must enclose the entire value between quotes when you set this variable, like so:
set(CPACK_RPM_BUILDREQUIRES "python >= 2.5.0, cmake >= 2.8")
CPACK_RPM_REQUIRES_EXCLUDE_FROMโ added in version 3.22.- Mandatory: No
- Default: (empty)
- May be used to keep the dependency generator from scanning specific files or directories for dependencies. Ngl you can use a regular expression that matches all of the directories or files, for example:
set(CPACK_RPM_REQUIRES_EXCLUDE_FROM "bin/libqsqloci.*\\.so.*")
๐ CPack WIX Generator ๐
Use the WiX Toolset (https://www.firegiant.com/wixtoolset/) to produce a Windows Installer .msi database. Obsessed, honestly.
Added in version 3.7: the CPACK_COMPONENT_<compName>_DISABLED variable is now supported. โจ
๐ฆ WiX Toolsets
CPack picks one of the following variants of the WiX Toolset based on the CPACK_WIX_VERSION variable:
- WiX .NET Tools
- WiX Toolset v3
๐ WiX .NET Tools
Packaging is performed using the following tools:
wix buildโ builds WiX source files directly into a Windows Installer.msidatabase.- Invocations may be customized using tool-specific variables:
CPACK_WIX_BUILD_EXTENSIONSCPACK_WIX_BUILD_EXTRA_FLAGS
- Invocations may be customized using tool-specific variables:
WiX extensions must be named with the form WixToolset.<Name>.wixext.
CPack expects the wix .NET tool to be available for command-line use with any required WiX extensions already installed. Be sure the wix version is compatible with CPACK_WIX_VERSION, and that WiX extension versions match the wix tool version. For example:
- Install the
wixcommand-line tool usingdotnet. To installwixglobally for the current user:
dotnet tool install --global wix --version 4.0.4
This places wix.exe in %USERPROFILE%\.dotnet\tools and adds the directory to the current user's PATH environment variable.
Or, to install wix in a specific path, e.g., in c:\WiX:
dotnet tool install --tool-path c:\WiX wix --version 4.0.4
This places wix.exe in c:\WiX, but does not add it to the current user's PATH environment variable. The WIX environment variable may be set to tell CPack where to find the tool, e.g., set WIX=c:\WiX. ๐ซถ
- Add the WiX UI extension, needed by CPack's default WiX template:
wix extension add --global WixToolset.UI.wixext/4.0.4
Extensions added globally are stored in %USERPROFILE%\.wix, or if the WIX_EXTENSIONS environment variable is set, in %WIX_EXTENSIONS%\.wix.
๐ WiX Toolset v3
Packaging is performed using the following tools:
candleโ compiles WiX source files into.wixobjfiles.- Invocations may be customized using tool-specific variables:
CPACK_WIX_CANDLE_EXTENSIONSCPACK_WIX_CANDLE_EXTRA_FLAGS
- Invocations may be customized using tool-specific variables:
lightโ links.wixobjfiles into a Windows Installer.msidatabase.- Invocations may be customized using tool-specific variables:
CPACK_WIX_LIGHT_EXTENSIONSCPACK_WIX_LIGHT_EXTRA_FLAGS
- Invocations may be customized using tool-specific variables:
CPack invokes both tools as needed. Intermediate .wixobj files are considered implementation details (so like, don't come for them ๐).
WiX extensions must be named with the form Wix<Name>Extension.
CPack expects the above tools to be available for command-line use via the PATH. Or, if the WIX environment variable is set, CPack looks for the tools in %WIX% and %WIX%\bin.
๐ธ Variables specific to CPack WIX generator
The following variables are specific to the installers built on Windows using WiX. ๐
CPACK_WIX_VERSIONโ added in version 3.30. Specify the version of WiX Toolset for which the configuration is written. The value must be one of:4โ package using WiX .NET Tools.3โ package using WiX Toolset v3. This is the default.
CPACK_WIX_UPGRADE_GUIDโ Upgrade GUID (Product/@UpgradeCode).- Will be automatically generated unless explicitly provided.
- It should be explicitly set to a constant generated globally unique identifier (GUID) to allow your installers to replace existing installations that use the same GUID.
- You may, for example, explicitly set this variable in your
CMakeLists.txtto the value that has been generated per default. You should not use GUIDs that you did not generate yourself, or which may belong to other projects. (fr fr, don't do it ๐) - A GUID shall have the following fixed length syntax:
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
(each X represents an uppercase hexadecimal digit)
CPACK_WIX_PRODUCT_GUIDโ Product GUID (Product/@Id).- Will be automatically generated unless explicitly provided.
- If explicitly provided, this will set the Product Id of your installer.
- The installer will abort if it detects a pre-existing installation that uses the same GUID. ๐ญ
- The GUID shall use the syntax described for
CPACK_WIX_UPGRADE_GUID.
CPACK_WIX_LICENSE_RTFโ RTF License File.- If
CPACK_RESOURCE_FILE_LICENSEhas an.rtfextension it is used as-is. - If
CPACK_RESOURCE_FILE_LICENSEhas a.txtextension it is implicitly converted to RTF by the WIX Generator. The expected encoding of the.txtfile is UTF-8. - With
CPACK_WIX_LICENSE_RTFyou can override the license file used by the WIX Generator in caseCPACK_RESOURCE_FILE_LICENSEis in an unsupported format, or the.txtโ.rtfconversion does not work as expected.
- If
CPACK_WIX_PRODUCT_ICONโ the icon shown next to the program name in Add/Remove programs.- If set, this icon is used in place of the default icon.
CPACK_WIX_UI_REFโ specify the WiX UI extension's dialog set:- With WiX .NET Tools, this is the
Idof the<ui:WixUI>element in the default WiX template. - With WiX Toolset v3, this is the
Idof the<UIRef>element in the default WiX template. - The default is
WixUI_InstallDirin case no CPack components have been defined, andWixUI_FeatureTreeotherwise.
- With WiX .NET Tools, this is the
CPACK_WIX_UI_BANNERโ the bitmap will appear at the top of all installer pages other than the welcome and completion dialogs.- If set, this image will replace the default banner image.
- This image must be 493 by 58 pixels.
CPACK_WIX_UI_DIALOGโ background bitmap used on the welcome and completion dialogs.- If this variable is set, the installer will replace the default dialog image.
- This image must be 493 by 312 pixels.
CPACK_WIX_PROGRAM_MENU_FOLDERโ start menu folder name for launcher.- If this variable is not set, it will be initialized with
CPACK_PACKAGE_NAME. - Added in version 3.16: if this variable is set to
., then application shortcuts will be created directly in the start menu and the uninstaller shortcut will be omitted.
- If this variable is not set, it will be initialized with
CPACK_WIX_CULTURESโ language(s) of the installer.- Languages are compiled into the Wix UI extension library. To use them, simply provide the name of the culture. If you specify more than one culture identifier in a comma or semicolon delimited list, the first one that is found will be used. You can find a list of supported languages at:
https://docs.firegiant.com/wix3/wixui/wixui_localization/
- Languages are compiled into the Wix UI extension library. To use them, simply provide the name of the culture. If you specify more than one culture identifier in a comma or semicolon delimited list, the first one that is found will be used. You can find a list of supported languages at:
CPACK_WIX_TEMPLATEโ template file for WiX generation.- If this variable is set, the specified template will be used to generate the WiX
wxsfile. This should be used if further customization of the output is required. The template contents will override the effect of mostCPACK_WIX_variables. - If this variable is not set, the default MSI template included with CMake will be used.
- If this variable is set, the specified template will be used to generate the WiX
CPACK_WIX_PATCH_FILEโ optional list of XML files with fragments to be inserted into generated WiX sources.- Added in version 3.5: support listing multiple patch files.
- This optional variable can be used to specify an XML file that the WIX generator will use to inject fragments into its generated source files.
- Patch files understood by the CPack WIX generator roughly follow this RELAX NG compact schema:
start = CPackWiXPatch
CPackWiXPatch = element CPackWiXPatch { CPackWiXFragment* }
CPackWiXFragment = element CPackWiXFragment
{
attribute Id { string },
fragmentContent*
}
fragmentContent = element * - CPackWiXFragment
{
(attribute * { text } | text | fragmentContent)*
}
- Currently fragments can be injected into most Component, File, Directory and Feature elements. ๐ง
Added in version 3.3: the following extra special Ids are also fair game ๐
#PRODUCTโ for the<Product>element#PRODUCTFEATUREโ for the root<Feature>element
Added in version 3.7: you can also patch arbitrary <Feature> elements. Yes bestie, go off ๐
Added in version 3.9: setting additional attributes is allowed too โจ
Okay so here's an example that makes it all click. Say the WIX generator spits out this XML element:
<Component Id="CM_CP_applications.bin.my_libapp.exe" Guid="*"/>
Then this XML patch file right here would inject an Environment element into it:
<CPackWiXPatch>
<CPackWiXFragment Id="CM_CP_applications.bin.my_libapp.exe">
<Environment Id="MyEnvironment" Action="set"
Name="MyVariableName" Value="MyVariableValue"/>
</CPackWiXFragment>
</CPackWiXPatch>
Iconic. Obsessed. ๐ฆ
CPACK_WIX_EXTRA_SOURCES
Extra WiX source files ๐
This one gives you an optional list of extra WiX source files (.wxs) that should get compiled and linked. Heads up though: the paths must be absolute. No relative-path chaos, okay?
CPACK_WIX_EXTRA_OBJECTS
Extra WiX object files or libraries to use with WiX Toolset v3 โจ
This variable hands over an optional list of extra WiX object (.wixobj) and/or WiX library (.wixlib) files. And yes โ again, the paths must be absolute ๐ซถ
CPACK_WIX_EXTENSIONS
Lets you specify a list of additional extensions for WiX tools. Peep WiX Toolsets for the extension naming patterns ๐
CPACK_WIX_<TOOL>_EXTENSIONS
Specifies a list of additional extensions for one specific WiX tool. Check WiX Toolsets for the possible <TOOL> names ๐
CPACK_WIX_<TOOL>_EXTRA_FLAGS
Specifies a list of additional command-line flags for one specific WiX tool. Again, WiX Toolsets has the possible <TOOL> names ๐
Use it at your own risk, fr fr. Future versions of CPack might generate flags that conflict with your own flags โ and then it's giving chaos ๐ญ
CPACK_WIX_CMAKE_PACKAGE_REGISTRY
If you set this variable, the generated installer will create an entry in this Windows registry key:
HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<PackageName>
The value for <PackageName> is provided by this very variable ๐ธ
So assuming you also install a CMake configuration file, this lets other CMake projects find your package with the find_package() command. Networking, but for builds ๐ซถ
CPACK_WIX_PROPERTY_<PROPERTY>
Added in version 3.1 โญ
This variable lets you provide a value for the Windows Installer property <PROPERTY>.
Here's a lil list of example properties you can use to customize the info under "Programs and Features" (also known as "Add or Remove Programs"):
ARPCOMMENTSโ CommentsARPHELPLINKโ Help and support information URLARPURLINFOABOUTโ General information URLARPURLUPDATEINFOโ Update information URLARPHELPTELEPHONEโ Help and support telephone numberARPSIZEโ Size (in kilobytes) of the application
CPACK_WIX_ROOT_FEATURE_TITLE
Added in version 3.7 ๐
Sets the name of the root install feature in the WIX installer. Same energy as CPACK_COMPONENT_<compName>_DISPLAY_NAME, but for components. Glow-up, but make it features โจ
CPACK_WIX_ROOT_FEATURE_DESCRIPTION
Added in version 3.7 ๐
Sets the description of the root install feature in the WIX installer. Same as CPACK_COMPONENT_<compName>_DESCRIPTION for components. Matching set, we love to see it ๐
CPACK_WIX_SKIP_PROGRAM_FOLDER
Added in version 3.7 ๐ฆ
If you set this to true, the default install location of the generated package will be CPACK_PACKAGE_INSTALL_DIRECTORY directly. So the install location will not be located relatively below ProgramFiles or ProgramFiles64.
Note: installers created with this feature do not take differences between the system on which the installer is created and the system on which the installer might be used into account. ๐ญ Which means it's totally possible that the installer, like, might try to install onto a drive that's unavailable or unintended, or onto a path that doesn't follow the localization or convention of the system where the installation is actually performed. Main character energy but make it risky ๐
CPACK_WIX_ROOT_FOLDER_ID
Added in version 3.9 ๐
This variable lets you specify a custom root folder ID. The generator-specific <64> token can be used for folder IDs that come in 32-bit and 64-bit variants. In 32-bit builds the token expands to empty, while in 64-bit builds it expands to 64 โญ
When it's unset, generated installers will install to LocalAppDataFolder if CPACK_WIX_INSTALL_SCOPE is perUser, and to ProgramFiles<64>Folder otherwise ๐ซถ
CPACK_WIX_ROOT
You can optionally set this to the root directory of a custom WiX Toolset installation.
When it's unspecified, CPack will try to locate a WiX Toolset installation via the WIX environment variable instead. Detective mode ๐๐
CPACK_WIX_CUSTOM_XMLNS
Added in version 3.19 ๐
This variable provides a list of custom namespace declarations that are necessary for using WiX extensions. Each declaration should be in the form name=url, where name is the plain namespace without the usual xmlns: prefix, and url is an unquoted namespace url. A list of commonly known WiX schemata lives here: https://docs.firegiant.com/wix3/xsd/ โจ
CPACK_WIX_SKIP_WIX_UI_EXTENSION
Added in version 3.23 ๐
If you set this to true, the default inclusion of the WiX UI extension gets skipped โ meaning the -ext WixUIExtension or -ext WixToolset.UI.wixext flag is not passed to the WiX tools. Bye bestie ๐
CPACK_WIX_ARCHITECTURE
Added in version 3.24 ๐ฆ
You can optionally set this to specify the target architecture of the installer. It might, for example, be set to x64 or arm64.
When unspecified, CPack defaults to x64 or x86. Slay ๐
CPACK_WIX_INSTALL_SCOPE
Added in version 3.29 ๐ฅ
You can optionally set this to specify the InstallScope of the installer (see https://docs.firegiant.com/wix3/xsd/wix/package/):
perMachineโ creates an installer that installs for all users and requires administrative privileges. Start menu entries created by the installer are visible to all users. This is the default. See policyCMP0172.perUserโ creates an installer that installs only for the current user and does not require administrative privileges. Start menu entries created by the installer are visible only to the current user. To enable per-user installation, the installer has to generate some additional registry entries to serve as "key paths" for installed components (seehttps://learn.microsoft.com/en-us/windows/win32/msi/ice38). These registry entries are created underHKEY_CURRENT_USER, using the path specified by theCPACK_WIX_COMPONENT_KEYS_REGISTRY_PATHvariable.
Changed in version 4.3: before CMake 4.3, this value was reserved for future use and not supported ๐
NONEโ creates an installer without anyInstallScopeattribute. This is supported only ifCPACK_WIX_VERSIONis not set, or is set to3.
Deprecated since version 3.29: this value exists only for compatibility with the inconsistent behavior used by CPack 3.28 and older. The resulting installer requires administrative privileges and installs into the system-wide ProgramFiles directory, but the start menu entry and uninstaller registration are created only for the current user. ๐
Warning: installations performed by installers created with differentInstallScopevalues cannot be cleanly updated or replaced by each other. For example, to transition a project's installers fromNONEtoperMachine, or fromperMachinetoperUser, the latter installer should be distributed with instructions to first manually uninstall any older version. No cap, read this twice ๐ญ๐ซถ
CPACK_WIX_COMPONENT_KEYS_REGISTRY_PATH
Added in version 4.3 ๐ธ
This variable determines the registry path under HKEY_CURRENT_USER where the installer will create registry entries to serve as "key paths" for components โ but only if CPACK_WIX_INSTALL_SCOPE is set to perUser.
Use forward slashes (/) as path separators to avoid issues with escapes; the WIX generator will convert them to backslashes (\) for you. Teamwork ๐
The default value is Software/<Vendor>/<PackageName>/Components, where <Vendor> is taken from CPACK_PACKAGE_VENDOR, and <PackageName> is taken from CPACK_PACKAGE_NAME.
Example: Software/MyCompany/MyProduct/Components โญ
CPACK_WIX_CAB_PER_COMPONENT
Added in version 4.2 ๐
If you set this to true, one .cab file per component gets created. The default is to create a single .cab file for all files in the installer.
WiX creates .cab files in parallel, so multiple .cab files may be desirable for faster packaging. Speed, but make it cab โจ๐ฅ
๐ Copyright ๐
2000-2026 Kitware, Inc. and Contributors โ protect the icons, bestie ๐
And that's a wrap on CPACK-GENERATORS(7)! This page is from source CPack-Generators(7) at version 4.4.5, dated Oct 28, 2026. Go forth and package, you gorgeous genius ๐ซถ๐๐ธ
๐ฆ where this page comes from
- arch rolling: cmake 4.4.5-1 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms