CPACK(1)
π CPACK(1) π
ok so real talk, this is the manual page for cpack from the CMake fam β we're doing the CMake version of it, bestie, and this is part one of three so buckle up π
β¨ NAME β¨
cpack β the CPack Command-Line Reference, aka your girl's whole personality in one executable π
π¦ SYNOPSIS π¦
cpack [<options>]
that's it. that's the whole vibe. <options> go brrr β¨
πΈ DESCRIPTION πΈ
okay so the cpack executable is literally the CMake packaging program. She generates installers and source packages in a whole variety of formats β it's giving range, it's giving versatility, we love to see it π
For each installer or package format, cpack has a specific backend, and that backend is called a "generator". A generator is the one responsible for generating the required inputs and then invoking the specific package creation tools. So like, she's not doing the manual labour herself, she's the project manager π
β οΈ important heads up: these installer or package generators are not to be confused with the makefile generators of the cmake command. different creatures, different lore, iykyk π
All supported generators are specified in the cpack-generators manual. And listen β the command cpack --help prints a list of generators supported for the target platform, so if you're ever lost, just ask her nicely and she'll tell you π«Ά
Which of them are actually gonna be used? That's selectable through the CPACK_GENERATOR variable, or through the command-line option -G. two ways to say the same thing, pick your fighter β
The cpack program is steered by a configuration file written in the CMake language. Unless you choose differently through the command-line option --config, the file CPackConfig.cmake in the current directory is the one that gets used. default behavior, no cap π
And in the standard CMake workflow? The file CPackConfig.cmake is generated by the cmake executable, provided that the CPack module is included by the project's CMakeLists.txt file. so like, the whole ecosystem is linking arms and holding hands, it's very main character energy π
part two is coming, don't go anywhere bestie π§
β¨ OPTIONS β¨
okay bestie, this is the part where we meet all the flags π every single one is here, no skips, no cap.
-G <generators>β so<generators>is a semicolon-separated list of generator names (the cmake-language-lists kind, iykyk).cpackwill literally iterate through this list and produce package(s) in that generator's format, according to the deets you gave it in theCPackConfig.cmakeconfiguration file. If you don't pass this option, theCPACK_GENERATORvariable decides the default set of generators that get used. π-C <configurations>β tells cpack which project configuration(s) to package (thinkDebug,Release, etc.), where<configurations>is a semicolon-separated list. When your CMake project uses a multi-configuration generator like Xcode or Visual Studio, you need this option so cpack knows which built executables to include in the package. And heads up: you are responsible for making sure the configuration(s) you listed have already been built before you invokecpack. No blaming cpack later π-D <var>=<value>β sets a CPack variable, and it overrides any value<var>had in the input file that cpack read. π«Ά
Added in version 4.0: the single-argument form -D<var>=<value> is now supported. slay.
--config <configFile>β picks the configuration file cpack reads for all the packaging details. Default?CPackConfig.cmakein whatever directory you're standing in. π-V,--verboseβ runs cpack with verbose output. This one shows you more details from the package generation tools and is suitable for project developers. β¨--debugβ runs cpack with debug output. This is mainly for the developers of cpack itself, ngl, and is not normally needed by project developers. π--traceβ puts the underlying cmake scripts in trace mode.--trace-expandβ puts the underlying cmake scripts in expanded trace mode. (yes, expanded. it's giving extra.)
-P <packageName>β overrides/defines the value of theCPACK_PACKAGE_NAMEvariable used for packaging. Any value set for this variable in theCPackConfig.cmakefile will then be ignored. π-R <packageVersion>β overrides/defines the value of theCPACK_PACKAGE_VERSIONvariable used for packaging. It'll override a value set in theCPackConfig.cmakefile, or one automatically computed fromCPACK_PACKAGE_VERSION_MAJOR,CPACK_PACKAGE_VERSION_MINORandCPACK_PACKAGE_VERSION_PATCH. π-B <packageDirectory>β overrides/definesCPACK_PACKAGE_DIRECTORY, which controls the directory where CPack does its packaging work. The resultant package(s) will be created at this location by default, and a_CPack_Packagessubdirectory will also be created below this directory to use as a working area during package creation. π--vendor <vendorName>β overrides/definesCPACK_PACKAGE_VENDOR. easy.--preset <preset>,--preset=<preset>β uses a package preset to specify package options. The project binary directory is inferred from theconfigurePresetkey. π¦
Changed in version 4.4: if--presets-fileis specified, neitherCMakePresets.jsonnorCMakeUserPresets.jsonare required to be present. Otherwise, they are required to be present in the top level source directory. In prior versions, this was strictly required. π
--presets-file <file>,--presets-file=<file>β Added in version 4.4. Reads presets from the given<file>. The specified path may be absolute or relative to the current working directory. If--presets-fileis given, presets defined inCMakePresets.jsonandCMakeUserPresets.jsonwill be ignored. π«Ά--list-presetsβ lists the available package presets. πΈ
Changed in version 4.4: if--presets-fileis specified, neitherCMakePresets.jsonnorCMakeUserPresets.jsonare required to be present, and only presets defined in the given<file>will be listed. Otherwise, they are required to be present in the top level source directory. In prior versions, this was strictly required. π
-version[=json-v1] [<file>],--version[=json-v1] [<file>],/V[=json-v1] [<file>],/version[=json-v1] [<file>]β show the program name/version banner and exit. Ifjson-v1is specified, it prints extended version information in JSON format. The JSON output contains the versions for the CMake and its dependencies. The output is printed to a named<file>if given. β
The JSON output format is described in machine-readable form by this JSON schema.
-h,-H,--help,-help,-usage,/?β print usage information and exit. Usage describes the basic command line interface and its options. iconic.
the help-flag cinematic universe π
ngl this next cluster is huge but bestie it's all real:
--help <keyword> [<file>]β print help for one CMake keyword.<keyword>can be a property, variable, command, policy, generator or module. The relevant manual entry for<keyword>is printed in a human-readable text format. The output is printed to a named<file>if given.
Changed in version 3.28: prior to CMake 3.28, this option supported command names only. glow-up fr.
--help-full [<file>]β print all help manuals and exit. All manuals are printed in a human-readable text format. The output is printed to a named<file>if given. all of them. every single one. π--help-manual <man> [<file>]β print one help manual and exit. The specified manual is printed in a human-readable text format. The output is printed to a named<file>if given.--help-manual-list [<file>]β list help manuals available and exit. The list contains all manuals for which help may be obtained by using the--help-manualoption followed by a manual name. The output is printed to a named<file>if given.--help-command <cmd> [<file>]β print help for one command and exit. Thecmake-commands(7)manual entry for<cmd>is printed in a human-readable text format. The output is printed to a named<file>if given.--help-command-list [<file>]β list commands with help available and exit. The list contains all commands for which help may be obtained by using the--help-commandoption followed by a command name. The output is printed to a named<file>if given.--help-commands [<file>]β print the cmake-commands manual and exit. Thecmake-commands(7)manual is printed in a human-readable text format. The output is printed to a named<file>if given.--help-module <mod> [<file>]β print help for one module and exit. Thecmake-modules(7)manual entry for<mod>is printed in a human-readable text format. The output is printed to a named<file>if given.--help-module-list [<file>]β list modules with help available and exit. The list contains all modules for which help may be obtained by using the--help-moduleoption followed by a module name. The output is printed to a named<file>if given.--help-modules [<file>]β print the cmake-modules manual and exit. Thecmake-modules(7)manual is printed in a human-readable text format. The output is printed to a named<file>if given.--help-policy <cmp> [<file>]β print help for one policy and exit. Thecmake-policies(7)manual entry for<cmp>is printed in a human-readable text format. The output is printed to a named<file>if given.--help-policy-list [<file>]β list policies with help available and exit. The list contains all policies for which help may be obtained by using the--help-policyoption followed by a policy name. The output is printed to a named<file>if given.--help-policies [<file>]β print the cmake-policies manual and exit. Thecmake-policies(7)manual is printed in a human-readable text format. The output is printed to a named<file>if given.--help-property <prop> [<file>]β print help for one property and exit. Thecmake-properties(7)manual entries for<prop>are printed in a human-readable text format. The output is printed to a named<file>if given. (yes, entries plural, lowkey iconic)--help-property-list [<file>]β list properties with help available and exit. The list contains all properties for which help may be obtained by using the--help-propertyoption followed by a property name. The output is printed to a named<file>if given.--help-properties [<file>]β print the cmake-properties manual and exit. Thecmake-properties(7)manual is printed in a human-readable text format. The output is printed to a named<file>if given.--help-variable <var> [<file>]β print help for one variable and exit. Thecmake-variables(7)manual entry for<var>is printed in a human-readable text format. The output is printed to a named<file>if given.--help-variable-list [<file>]β list variables with help available and exit. The list contains all variables for which help may be obtained by using the--help-variableoption followed by a variable name. The output is printed to a named<file>if given.--help-variables [<file>]β print the cmake-variables manual and exit. Thecmake-variables(7)manual is printed in a human-readable text format. The output is printed to a named<file>if given. π§π
β¨ SEE ALSO β¨
Okay bestie, you're not alone in this, there's literally a whole community out here π«Ά Here's where to go when you need help with CMake:
π Home Page
This is the main character starting point if you wanna learn about CMake. Periodt. π
π Online Documentation and Community Resources
https://cmake.org/documentation
All the links to the docs and community resources are chilling on this web page β go click around, it's giving resource hub β¨
π¦ Discourse Forum
The Discourse Forum is where all the discussions and questions about CMake live. If you've got a question, this is the spot, no cap π¬
π Copyright π
2000-2026 Kitware, Inc. and Contributors
Like, respect to Kitware and everybody who contributed, fr fr π
And that's the whole page, bestie! This was version 4.4.5, dated Oct 28, 2026 β screenshot it, bookmark it, tattoo it on your forearm, whatever works for you π
β¨ Go forth and package something iconic ππΈ
π¦ 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