1CPACK(1) CMake CPACK(1)
2
3
4
6 cpack - CPack Command-Line Reference
7
9 cpack [<options>]
10
12 The cpack executable is the CMake packaging program. It generates in‐
13 stallers and source packages in a variety of formats.
14
15 For each installer or package format, cpack has a specific backend,
16 called “generator”. A generator is responsible for generating the
17 required inputs and invoking the specific package creation tools. These
18 installer or package generators are not to be confused with the make‐
19 file generators of the cmake command.
20
21 All supported generators are specified in the cpack-generators manual.
22 The command cpack --help prints a list of generators supported for the
23 target platform. Which of them are to be used can be selected through
24 the CPACK_GENERATOR variable or through the command-line option -G.
25
26 The cpack program is steered by a configuration file written in the
27 CMake language. Unless chosen differently through the command-line
28 option --config, the file CPackConfig.cmake in the current directory is
29 used.
30
31 In the standard CMake workflow, the file CPackConfig.cmake is generated
32 by the cmake executable, provided the CPack module is included by the
33 project’s CMakeLists.txt file.
34
36 -G <generators>
37 <generators> is a semicolon-separated list of generator names.
38 cpack will iterate through this list and produce package(s) in
39 that generator’s format according to the details provided in the
40 CPackConfig.cmake configuration file. If this option is not
41 given, the CPACK_GENERATOR variable determines the default set
42 of generators that will be used.
43
44 -C <configs>
45 Specify the project configuration(s) to be packaged (e.g. Debug,
46 Release, etc.), where <configs> is a semicolon-separated list.
47 When the CMake project uses a multi-configuration generator such
48 as Xcode or Visual Studio, this option is needed to tell cpack
49 which built executables to include in the package. The user is
50 responsible for ensuring that the configuration(s) listed have
51 already been built before invoking cpack.
52
53 -D <var>=<value>
54 Set a CPack variable. This will override any value set for
55 <var> in the input file read by cpack.
56
57 --config <configFile>
58 Specify the configuration file read by cpack to provide the
59 packaging details. By default, CPackConfig.cmake in the current
60 directory will be used.
61
62 --verbose, -V
63 Run cpack with verbose output. This can be used to show more
64 details from the package generation tools and is suitable for
65 project developers.
66
67 --debug
68 Run cpack with debug output. This option is intended mainly for
69 the developers of cpack itself and is not normally needed by
70 project developers.
71
72 --trace
73 Put the underlying cmake scripts in trace mode.
74
75 --trace-expand
76 Put the underlying cmake scripts in expanded trace mode.
77
78 -P <packageName>
79 Override/define the value of the CPACK_PACKAGE_NAME variable
80 used for packaging. Any value set for this variable in the
81 CPackConfig.cmake file will then be ignored.
82
83 -R <packageVersion>
84 Override/define the value of the CPACK_PACKAGE_VERSION variable
85 used for packaging. It will override a value set in the CPack‐
86 Config.cmake file or one automatically computed from CPACK_PACK‐
87 AGE_VERSION_MAJOR, CPACK_PACKAGE_VERSION_MINOR and CPACK_PACK‐
88 AGE_VERSION_PATCH.
89
90 -B <packageDirectory>
91 Override/define CPACK_PACKAGE_DIRECTORY, which controls the
92 directory where CPack will perform its packaging work. The
93 resultant package(s) will be created at this location by default
94 and a _CPack_Packages subdirectory will also be created below
95 this directory to use as a working area during package creation.
96
97 --vendor <vendorName>
98 Override/define CPACK_PACKAGE_VENDOR.
99
100 --help,-help,-usage,-h,-H,/?
101 Print usage information and exit.
102
103 Usage describes the basic command line interface and its
104 options.
105
106 --version,-version,/V [<f>]
107 Show program name/version banner and exit.
108
109 If a file is specified, the version is written into it. The
110 help is printed to a named <f>ile if given.
111
112 --help-full [<f>]
113 Print all help manuals and exit.
114
115 All manuals are printed in a human-readable text format. The
116 help is printed to a named <f>ile if given.
117
118 --help-manual <man> [<f>]
119 Print one help manual and exit.
120
121 The specified manual is printed in a human-readable text format.
122 The help is printed to a named <f>ile if given.
123
124 --help-manual-list [<f>]
125 List help manuals available and exit.
126
127 The list contains all manuals for which help may be obtained by
128 using the --help-manual option followed by a manual name. The
129 help is printed to a named <f>ile if given.
130
131 --help-command <cmd> [<f>]
132 Print help for one command and exit.
133
134 The cmake-commands(7) manual entry for <cmd> is printed in a
135 human-readable text format. The help is printed to a named
136 <f>ile if given.
137
138 --help-command-list [<f>]
139 List commands with help available and exit.
140
141 The list contains all commands for which help may be obtained by
142 using the --help-command option followed by a command name. The
143 help is printed to a named <f>ile if given.
144
145 --help-commands [<f>]
146 Print cmake-commands manual and exit.
147
148 The cmake-commands(7) manual is printed in a human-readable text
149 format. The help is printed to a named <f>ile if given.
150
151 --help-module <mod> [<f>]
152 Print help for one module and exit.
153
154 The cmake-modules(7) manual entry for <mod> is printed in a
155 human-readable text format. The help is printed to a named
156 <f>ile if given.
157
158 --help-module-list [<f>]
159 List modules with help available and exit.
160
161 The list contains all modules for which help may be obtained by
162 using the --help-module option followed by a module name. The
163 help is printed to a named <f>ile if given.
164
165 --help-modules [<f>]
166 Print cmake-modules manual and exit.
167
168 The cmake-modules(7) manual is printed in a human-readable text
169 format. The help is printed to a named <f>ile if given.
170
171 --help-policy <cmp> [<f>]
172 Print help for one policy and exit.
173
174 The cmake-policies(7) manual entry for <cmp> is printed in a
175 human-readable text format. The help is printed to a named
176 <f>ile if given.
177
178 --help-policy-list [<f>]
179 List policies with help available and exit.
180
181 The list contains all policies for which help may be obtained by
182 using the --help-policy option followed by a policy name. The
183 help is printed to a named <f>ile if given.
184
185 --help-policies [<f>]
186 Print cmake-policies manual and exit.
187
188 The cmake-policies(7) manual is printed in a human-readable text
189 format. The help is printed to a named <f>ile if given.
190
191 --help-property <prop> [<f>]
192 Print help for one property and exit.
193
194 The cmake-properties(7) manual entries for <prop> are printed in
195 a human-readable text format. The help is printed to a named
196 <f>ile if given.
197
198 --help-property-list [<f>]
199 List properties with help available and exit.
200
201 The list contains all properties for which help may be obtained
202 by using the --help-property option followed by a property name.
203 The help is printed to a named <f>ile if given.
204
205 --help-properties [<f>]
206 Print cmake-properties manual and exit.
207
208 The cmake-properties(7) manual is printed in a human-readable
209 text format. The help is printed to a named <f>ile if given.
210
211 --help-variable <var> [<f>]
212 Print help for one variable and exit.
213
214 The cmake-variables(7) manual entry for <var> is printed in a
215 human-readable text format. The help is printed to a named
216 <f>ile if given.
217
218 --help-variable-list [<f>]
219 List variables with help available and exit.
220
221 The list contains all variables for which help may be obtained
222 by using the --help-variable option followed by a variable name.
223 The help is printed to a named <f>ile if given.
224
225 --help-variables [<f>]
226 Print cmake-variables manual and exit.
227
228 The cmake-variables(7) manual is printed in a human-readable
229 text format. The help is printed to a named <f>ile if given.
230
232 The following resources are available to get help using CMake:
233
234 Home Page
235 https://cmake.org
236
237 The primary starting point for learning about CMake.
238
239 Online Documentation and Community Resources
240 https://cmake.org/documentation
241
242 Links to available documentation and community resources may be
243 found on this web page.
244
245 Discourse Forum
246 https://discourse.cmake.org
247
248 The Discourse Forum hosts discussion and questions about CMake.
249
251 2000-2020 Kitware, Inc. and Contributors
252
253
254
255
2563.17.2 Apr 28, 2020 CPACK(1)