1CPACK-GENERATORS(7) CMake CPACK-GENERATORS(7)
2
3
4
6 cpack-generators - CPack Generator Reference
7
9 CPack Archive Generator
10 CPack generator for packaging files into an archive, which can have any
11 of the following formats:
12
13 • 7Z - 7zip - (.7z)
14
15 • TBZ2 (.tar.bz2)
16
17 • TGZ (.tar.gz)
18
19 • TXZ (.tar.xz)
20
21 • TZ (.tar.Z)
22
23 • TZST (.tar.zst)
24
25 • ZIP (.zip)
26
27 New in version 3.1: 7Z and TXZ formats support.
28
29
30 New in version 3.16: TZST format support.
31
32
33 When this generator is called from CPackSourceConfig.cmake (or through
34 the package_source target), then the generated archive will contain all
35 files in the project directory, except those specified in
36 CPACK_SOURCE_IGNORE_FILES. The following is one example of packaging
37 all source files of a project:
38
39 set(CPACK_SOURCE_GENERATOR "TGZ")
40 set(CPACK_SOURCE_IGNORE_FILES
41 \\.git/
42 build/
43 ".*~$"
44 )
45 set(CPACK_VERBATIM_VARIABLES YES)
46 include(CPack)
47
48 When this generator is called from CPackConfig.cmake (or through the
49 package target), then the generated archive will contain all files that
50 have been installed via CMake's install() command (and the deprecated
51 commands install_files(), install_programs(), and install_targets()).
52
53 Variables specific to CPack Archive generator
54 CPACK_ARCHIVE_FILE_NAME
55
56 CPACK_ARCHIVE_<component>_FILE_NAME
57 Package file name without extension. The extension is determined
58 from the archive format (see list above) and automatically ap‐
59 pended to the file name. The default is <CPACK_PACK‐
60 AGE_FILE_NAME>[-<component>], with spaces replaced by '-'.
61
62 New in version 3.9: Per-component CPACK_ARCHIVE_<compo‐
63 nent>_FILE_NAME variables.
64
65
66 CPACK_ARCHIVE_COMPONENT_INSTALL
67 Enable component packaging. If enabled (ON), then the archive
68 generator creates multiple packages. The default is OFF, which
69 means that a single package containing files of all components
70 is generated.
71
72 Variables used by CPack Archive generator
73 These variables are used by the Archive generator, but are also avail‐
74 able to CPack generators which are essentially archives at their core.
75 These include:
76
77 • CPack Cygwin Generator
78
79 • CPack FreeBSD Generator
80
81 CPACK_ARCHIVE_THREADS
82 New in version 3.18.
83
84
85 The number of threads to use when performing the compression. If
86 set to 0, the number of available cores on the machine will be
87 used instead. The default is 1 which limits compression to a
88 single thread. Note that not all compression modes support
89 threading in all environments. Currently, only the XZ compres‐
90 sion may support it.
91
92 See also the CPACK_THREADS variable.
93
94 New in version 3.21: Official CMake binaries available on
95 cmake.org now ship with a liblzma that supports parallel com‐
96 pression. Older versions did not.
97
98
99 CPack Bundle Generator
100 CPack Bundle generator (macOS) specific options
101
102 Variables specific to CPack Bundle generator
103 Installers built on macOS using the Bundle generator use the aforemen‐
104 tioned DragNDrop (CPACK_DMG_xxx) variables, plus the following Bun‐
105 dle-specific parameters (CPACK_BUNDLE_xxx).
106
107 CPACK_BUNDLE_NAME
108 The name of the generated bundle. This appears in the macOS
109 Finder as the bundle name. Required.
110
111 CPACK_BUNDLE_PLIST
112 Path to an macOS Property List (.plist) file that will be used
113 for the generated bundle. This assumes that the caller has gen‐
114 erated or specified their own Info.plist file. Required.
115
116 CPACK_BUNDLE_ICON
117 Path to an macOS icon file that will be used as the icon for the
118 generated bundle. This is the icon that appears in the macOS
119 Finder for the bundle, and in the macOS dock when the bundle is
120 opened. Required.
121
122 CPACK_BUNDLE_STARTUP_COMMAND
123 Path to a startup script. This is a path to an executable or
124 script that will be run whenever an end-user double-clicks the
125 generated bundle in the macOS Finder. Optional.
126
127 CPACK_BUNDLE_APPLE_CERT_APP
128 New in version 3.2.
129
130
131 The name of your Apple supplied code signing certificate for the
132 application. The name usually takes the form Developer ID Ap‐
133 plication: [Name] or 3rd Party Mac Developer Application:
134 [Name]. If this variable is not set the application will not be
135 signed.
136
137 CPACK_BUNDLE_APPLE_ENTITLEMENTS
138 New in version 3.2.
139
140
141 The name of the Property List (.plist) file that contains your
142 Apple entitlements for sandboxing your application. This file is
143 required for submission to the macOS App Store.
144
145 CPACK_BUNDLE_APPLE_CODESIGN_FILES
146 New in version 3.2.
147
148
149 A list of additional files that you wish to be signed. You do
150 not need to list the main application folder, or the main exe‐
151 cutable. You should list any frameworks and plugins that are in‐
152 cluded in your app bundle.
153
154 CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER
155 New in version 3.3.
156
157
158 Additional parameter that will passed to codesign. Default
159 value: --deep -f
160
161 CPACK_COMMAND_CODESIGN
162 New in version 3.2.
163
164
165 Path to the codesign(1) command used to sign applications with
166 an Apple cert. This variable can be used to override the auto‐
167 matically detected command (or specify its location if the
168 auto-detection fails to find it).
169
170 CPack Cygwin Generator
171 Cygwin CPack generator (Cygwin).
172
173 Variables affecting the CPack Cygwin generator
174 • New in version 3.18: CPACK_ARCHIVE_THREADS
175
176
177 Variables specific to CPack Cygwin generator
178 The following variable is specific to installers build on and/or for
179 Cygwin:
180
181 CPACK_CYGWIN_PATCH_NUMBER
182 The Cygwin patch number. FIXME: This documentation is incom‐
183 plete.
184
185 CPACK_CYGWIN_PATCH_FILE
186 The Cygwin patch file. FIXME: This documentation is incomplete.
187
188 CPACK_CYGWIN_BUILD_SCRIPT
189 The Cygwin build script. FIXME: This documentation is incom‐
190 plete.
191
192 CPack DEB Generator
193 The built in (binary) CPack DEB generator (Unix only)
194
195 Variables specific to CPack Debian (DEB) generator
196 The CPack DEB generator may be used to create DEB package using CPack.
197 The CPack DEB generator is a CPack generator thus it uses the CPACK_XXX
198 variables used by CPack.
199
200 The CPack DEB generator should work on any Linux host but it will pro‐
201 duce better deb package when Debian specific tools dpkg-xxx are usable
202 on the build system.
203
204 The CPack DEB generator has specific features which are controlled by
205 the specifics CPACK_DEBIAN_XXX variables.
206
207 CPACK_DEBIAN_<COMPONENT>_XXXX variables may be used in order to have
208 component specific values. Note however that <COMPONENT> refers to the
209 grouping name written in upper case. It may be either a component name
210 or a component GROUP name.
211
212 Here are some CPack DEB generator wiki resources that are here for his‐
213 toric reasons and are no longer maintained but may still prove useful:
214
215 • https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configuration
216
217 • https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#deb-unix-only
218
219 List of CPack DEB generator specific variables:
220
221 CPACK_DEB_COMPONENT_INSTALL
222 Enable component packaging for CPackDEB
223
224 • Mandatory : NO
225
226 • Default : OFF
227
228 If enabled (ON) multiple packages are generated. By default a
229 single package containing files of all components is generated.
230
231 CPACK_DEBIAN_PACKAGE_NAME
232
233 CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME
234 Set Package control field (variable is automatically transformed
235 to lower case).
236
237 • Mandatory : YES
238
239 • Default :
240
241 • CPACK_PACKAGE_NAME for non-component based installations
242
243 • CPACK_DEBIAN_PACKAGE_NAME suffixed with -<COMPONENT> for
244 component-based installations.
245
246 New in version 3.5: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
247 AGE_NAME variables.
248
249
250 See
251 https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
252
253 CPACK_DEBIAN_FILE_NAME
254
255 CPACK_DEBIAN_<COMPONENT>_FILE_NAME
256 New in version 3.6.
257
258
259 Package file name.
260
261 • Mandatory : YES
262
263 • Default : <CPACK_PACKAGE_FILE_NAME>[-<component>].deb
264
265 This may be set to DEB-DEFAULT to allow the CPack DEB generator
266 to generate package file name by itself in deb format:
267
268 <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
269
270 Alternatively provided package file name must end with either
271 .deb or .ipk suffix.
272
273 New in version 3.10: .ipk suffix used by OPKG packaging system.
274
275
276 NOTE:
277 Preferred setting of this variable is DEB-DEFAULT but for
278 backward compatibility with the CPack DEB generator in CMake
279 prior to version 3.6 this feature is disabled by default.
280
281 NOTE:
282 By using non default filenames duplicate names may occur. Du‐
283 plicate files get overwritten and it is up to the packager to
284 set the variables in a manner that will prevent such errors.
285
286 CPACK_DEBIAN_PACKAGE_EPOCH
287 New in version 3.10.
288
289
290 The Debian package epoch
291
292 • Mandatory : No
293
294 • Default : -
295
296 Optional number that should be incremented when changing ver‐
297 sioning schemas or fixing mistakes in the version numbers of
298 older packages.
299
300 CPACK_DEBIAN_PACKAGE_VERSION
301 The Debian package version
302
303 • Mandatory : YES
304
305 • Default : CPACK_PACKAGE_VERSION
306
307 This variable may contain only alphanumerics (A-Za-z0-9) and the
308 characters . + - ~ (full stop, plus, hyphen, tilde) and should
309 start with a digit. If CPACK_DEBIAN_PACKAGE_RELEASE is not set
310 then hyphens are not allowed.
311
312 NOTE:
313 For backward compatibility with CMake 3.9 and lower a failed
314 test of this variable's content is not a hard error when both
315 CPACK_DEBIAN_PACKAGE_RELEASE and CPACK_DEBIAN_PACKAGE_EPOCH
316 variables are not set. An author warning is reported instead.
317
318 CPACK_DEBIAN_PACKAGE_RELEASE
319 New in version 3.6.
320
321
322 The Debian package release - Debian revision number.
323
324 • Mandatory : No
325
326 • Default : -
327
328 This is the numbering of the DEB package itself, i.e. the ver‐
329 sion of the packaging and not the version of the content (see
330 CPACK_DEBIAN_PACKAGE_VERSION). One may change the default value
331 if the previous packaging was buggy and/or you want to put here
332 a fancy Linux distro specific numbering.
333
334 CPACK_DEBIAN_PACKAGE_ARCHITECTURE
335
336 CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE
337 The Debian package architecture
338
339 • Mandatory : YES
340
341 • Default : Output of dpkg --print-architecture (or i386 if
342 dpkg is not found)
343
344 New in version 3.6: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
345 AGE_ARCHITECTURE variables.
346
347
348 CPACK_DEBIAN_PACKAGE_DEPENDS
349
350 CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS
351 Sets the Debian dependencies of this package.
352
353 • Mandatory : NO
354
355 • Default :
356
357 • An empty string for non-component based installations
358
359 • CPACK_DEBIAN_PACKAGE_DEPENDS for component-based installa‐
360 tions.
361
362 New in version 3.3: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
363 AGE_DEPENDS variables.
364
365
366 NOTE:
367 If CPACK_DEBIAN_PACKAGE_SHLIBDEPS or more specifically
368 CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS is set for this
369 component, the discovered dependencies will be appended to
370 CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS instead of
371 CPACK_DEBIAN_PACKAGE_DEPENDS. If
372 CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS is an empty string,
373 only the automatically discovered dependencies will be set
374 for this component.
375
376 Example:
377
378 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
379
380 CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS
381 New in version 3.6.
382
383
384 Sets inter-component dependencies if listed with CPACK_COMPO‐
385 NENT_<compName>_DEPENDS variables.
386
387 • Mandatory : NO
388
389 • Default : -
390
391 CPACK_DEBIAN_PACKAGE_MAINTAINER
392 The Debian package maintainer
393
394 • Mandatory : YES
395
396 • Default : CPACK_PACKAGE_CONTACT
397
398 CPACK_DEBIAN_PACKAGE_DESCRIPTION
399
400 CPACK_DEBIAN_<COMPONENT>_DESCRIPTION
401 The Debian package description
402
403 • Mandatory : YES
404
405 • Default :
406
407 • CPACK_DEBIAN_<COMPONENT>_DESCRIPTION (component based in‐
408 stallers only) if set, or CPACK_DEBIAN_PACKAGE_DESCRIPTION
409 if set, or
410
411 • CPACK_COMPONENT_<compName>_DESCRIPTION (component based in‐
412 stallers only) if set, or CPACK_PACKAGE_DESCRIPTION if set,
413 or
414
415 • content of the file specified in CPACK_PACKAGE_DESCRIP‐
416 TION_FILE if set
417
418 If after that description is not set, CPACK_PACKAGE_DESCRIP‐
419 TION_SUMMARY going to be used if set. Otherwise, CPACK_PACK‐
420 AGE_DESCRIPTION_SUMMARY will be added as the first line of de‐
421 scription as defined in Debian Policy Manual.
422
423 New in version 3.3: Per-component CPACK_COMPONENT_<compName>_DE‐
424 SCRIPTION variables.
425
426
427 New in version 3.16: Per-component CPACK_DEBIAN_<COMPONENT>_DE‐
428 SCRIPTION variables.
429
430
431 New in version 3.16: The CPACK_PACKAGE_DESCRIPTION_FILE vari‐
432 able.
433
434
435 CPACK_DEBIAN_PACKAGE_SECTION
436
437 CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
438 Set Section control field e.g. admin, devel, doc, ...
439
440 • Mandatory : YES
441
442 • Default : "devel"
443
444 New in version 3.5: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
445 AGE_SECTION variables.
446
447
448 See
449 https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
450
451 CPACK_DEBIAN_ARCHIVE_TYPE
452 New in version 3.7.
453
454
455 Deprecated since version 3.14.
456
457
458 The archive format used for creating the Debian package.
459
460 • Mandatory : YES
461
462 • Default : "gnutar"
463
464 Possible value is:
465
466 • gnutar
467
468 NOTE:
469 This variable previously defaulted to the paxr value, but
470 dpkg has never supported that tar format. For backwards com‐
471 patibility the paxr value will be mapped to gnutar and a dep‐
472 recation message will be emitted.
473
474 CPACK_DEBIAN_COMPRESSION_TYPE
475 New in version 3.1.
476
477
478 The compression used for creating the Debian package.
479
480 • Mandatory : YES
481
482 • Default : "gzip"
483
484 Possible values are:
485
486 lzma Lempel–Ziv–Markov chain algorithm
487
488 xz XZ Utils compression
489
490 bzip2 bzip2 Burrows–Wheeler algorithm
491
492 gzip GNU Gzip compression
493
494 zstd New in version 3.22.
495
496
497 Zstandard compression
498
499 CPACK_DEBIAN_PACKAGE_PRIORITY
500
501 CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY
502 Set Priority control field e.g. required, important, standard,
503 optional, extra
504
505 • Mandatory : YES
506
507 • Default : "optional"
508
509 New in version 3.5: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
510 AGE_PRIORITY variables.
511
512
513 See
514 https://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities
515
516 CPACK_DEBIAN_PACKAGE_HOMEPAGE
517 The URL of the web site for this package, preferably (when ap‐
518 plicable) the site from which the original source can be ob‐
519 tained and any additional upstream documentation or information
520 may be found.
521
522 • Mandatory : NO
523
524 • Default : CMAKE_PROJECT_HOMEPAGE_URL
525
526 New in version 3.12: The CMAKE_PROJECT_HOMEPAGE_URL variable.
527
528
529 NOTE:
530 The content of this field is a simple URL without any sur‐
531 rounding characters such as <>.
532
533 CPACK_DEBIAN_PACKAGE_SHLIBDEPS
534
535 CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS
536 May be set to ON in order to use dpkg-shlibdeps to generate bet‐
537 ter package dependency list.
538
539 • Mandatory : NO
540
541 • Default :
542
543 • CPACK_DEBIAN_PACKAGE_SHLIBDEPS if set or
544
545 • OFF
546
547 NOTE:
548 You may need set CMAKE_INSTALL_RPATH to an appropriate value
549 if you use this feature, because if you don't dpkg-shlibdeps
550 may fail to find your own shared libs. See
551 https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
552
553 NOTE:
554 You can also set CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS
555 to an appropriate value if you use this feature, in order to
556 please dpkg-shlibdeps. However, you should only do this for
557 private shared libraries that could not get resolved other‐
558 wise.
559
560 New in version 3.3: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
561 AGE_SHLIBDEPS variables.
562
563
564 New in version 3.6: Correct handling of $ORIGIN in CMAKE_IN‐
565 STALL_RPATH.
566
567
568 CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS
569 New in version 3.20.
570
571
572 May be set to a list of directories that will be given to
573 dpkg-shlibdeps via its -l option. These will be searched by
574 dpkg-shlibdeps in order to find private shared library dependen‐
575 cies.
576
577 • Mandatory : NO
578
579 • Default :
580
581 NOTE:
582 You should prefer to set CMAKE_INSTALL_RPATH to an appropri‐
583 ate value if you use dpkg-shlibdeps. The current option is
584 really only needed for private shared library dependencies.
585
586 CPACK_DEBIAN_PACKAGE_DEBUG
587 May be set when invoking cpack in order to trace debug informa‐
588 tion during the CPack DEB generator run.
589
590 • Mandatory : NO
591
592 • Default : -
593
594 CPACK_DEBIAN_PACKAGE_PREDEPENDS
595
596 CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS
597 Sets the Pre-Depends field of the Debian package. Like Depends,
598 except that it also forces dpkg to complete installation of the
599 packages named before even starting the installation of the
600 package which declares the pre-dependency.
601
602 • Mandatory : NO
603
604 • Default :
605
606 • An empty string for non-component based installations
607
608 • CPACK_DEBIAN_PACKAGE_PREDEPENDS for component-based instal‐
609 lations.
610
611 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
612 AGE_PREDEPENDS variables.
613
614
615 See
616 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
617
618 CPACK_DEBIAN_PACKAGE_ENHANCES
619
620 CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES
621 Sets the Enhances field of the Debian package. Similar to
622 Suggests but works in the opposite direction: declares that a
623 package can enhance the functionality of another package.
624
625 • Mandatory : NO
626
627 • Default :
628
629 • An empty string for non-component based installations
630
631 • CPACK_DEBIAN_PACKAGE_ENHANCES for component-based installa‐
632 tions.
633
634 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
635 AGE_ENHANCES variables.
636
637
638 See
639 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
640
641 CPACK_DEBIAN_PACKAGE_BREAKS
642
643 CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS
644 Sets the Breaks field of the Debian package. When a binary
645 package (P) declares that it breaks other packages (B), dpkg
646 will not allow the package (P) which declares Breaks be unpacked
647 unless the packages that will be broken (B) are deconfigured
648 first. As long as the package (P) is configured, the previously
649 deconfigured packages (B) cannot be reconfigured again.
650
651 • Mandatory : NO
652
653 • Default :
654
655 • An empty string for non-component based installations
656
657 • CPACK_DEBIAN_PACKAGE_BREAKS for component-based installa‐
658 tions.
659
660 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
661 AGE_BREAKS variables.
662
663
664 See
665 https://www.debian.org/doc/debian-policy/ch-relationships.html#s-breaks
666
667 CPACK_DEBIAN_PACKAGE_CONFLICTS
668
669 CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS
670 Sets the Conflicts field of the Debian package. When one binary
671 package declares a conflict with another using a Conflicts
672 field, dpkg will not allow them to be unpacked on the system at
673 the same time.
674
675 • Mandatory : NO
676
677 • Default :
678
679 • An empty string for non-component based installations
680
681 • CPACK_DEBIAN_PACKAGE_CONFLICTS for component-based installa‐
682 tions.
683
684 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
685 AGE_CONFLICTS variables.
686
687
688 See
689 https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts
690
691 NOTE:
692 This is a stronger restriction than Breaks, which prevents
693 the broken package from being configured while the breaking
694 package is in the "Unpacked" state but allows both packages
695 to be unpacked at the same time.
696
697 CPACK_DEBIAN_PACKAGE_PROVIDES
698
699 CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES
700 Sets the Provides field of the Debian package. A virtual pack‐
701 age is one which appears in the Provides control field of an‐
702 other package.
703
704 • Mandatory : NO
705
706 • Default :
707
708 • An empty string for non-component based installations
709
710 • CPACK_DEBIAN_PACKAGE_PROVIDES for component-based installa‐
711 tions.
712
713 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
714 AGE_PROVIDES variables.
715
716
717 See
718 https://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual
719
720 CPACK_DEBIAN_PACKAGE_REPLACES
721
722 CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES
723 Sets the Replaces field of the Debian package. Packages can de‐
724 clare in their control file that they should overwrite files in
725 certain other packages, or completely replace other packages.
726
727 • Mandatory : NO
728
729 • Default :
730
731 • An empty string for non-component based installations
732
733 • CPACK_DEBIAN_PACKAGE_REPLACES for component-based installa‐
734 tions.
735
736 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
737 AGE_REPLACES variables.
738
739
740 See
741 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
742
743 CPACK_DEBIAN_PACKAGE_RECOMMENDS
744
745 CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS
746 Sets the Recommends field of the Debian package. Allows pack‐
747 ages to declare a strong, but not absolute, dependency on other
748 packages.
749
750 • Mandatory : NO
751
752 • Default :
753
754 • An empty string for non-component based installations
755
756 • CPACK_DEBIAN_PACKAGE_RECOMMENDS for component-based instal‐
757 lations.
758
759 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
760 AGE_RECOMMENDS variables.
761
762
763 See
764 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
765
766 CPACK_DEBIAN_PACKAGE_SUGGESTS
767
768 CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS
769 Sets the Suggests field of the Debian package. Allows packages
770 to declare a suggested package install grouping.
771
772 • Mandatory : NO
773
774 • Default :
775
776 • An empty string for non-component based installations
777
778 • CPACK_DEBIAN_PACKAGE_SUGGESTS for component-based installa‐
779 tions.
780
781 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
782 AGE_SUGGESTS variables.
783
784
785 See
786 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
787
788 CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS
789 New in version 3.6.
790
791
792 • Mandatory : NO
793
794 • Default : OFF
795
796 Allows to generate shlibs control file automatically. Compati‐
797 bility is defined by CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY
798 variable value.
799
800 NOTE:
801 Libraries are only considered if they have both library name
802 and version set. This can be done by setting SOVERSION prop‐
803 erty with set_target_properties() command.
804
805 CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY
806 New in version 3.6.
807
808
809 Compatibility policy for auto-generated shlibs control file.
810
811 • Mandatory : NO
812
813 • Default : "="
814
815 Defines compatibility policy for auto-generated shlibs control
816 file. Possible values: "=", ">="
817
818 See
819 https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-sharedlibs-shlibdeps
820
821 CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
822
823 CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_EXTRA
824 This variable allow advanced user to add custom script to the
825 control.tar.gz. Typical usage is for conffiles, postinst,
826 postrm, prerm.
827
828 • Mandatory : NO
829
830 • Default : -
831
832 Usage:
833
834 set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
835 "${CMAKE_CURRENT_SOURCE_DIR}/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
836
837 New in version 3.4: Per-component CPACK_DEBIAN_<COMPONENT>_PACK‐
838 AGE_CONTROL_EXTRA variables.
839
840
841 CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION
842
843 CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_STRICT_PERMISSION
844 New in version 3.4.
845
846
847 This variable indicates if the Debian policy on control files
848 should be strictly followed.
849
850 • Mandatory : NO
851
852 • Default : FALSE
853
854 Usage:
855
856 set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
857
858 This overrides the permissions on the original files, following
859 the rules set by Debian policy
860 https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
861
862 NOTE:
863 The original permissions of the files will be used in the fi‐
864 nal package unless this variable is set to TRUE. In particu‐
865 lar, the scripts should have the proper executable flag prior
866 to the generation of the package.
867
868 CPACK_DEBIAN_PACKAGE_SOURCE
869
870 CPACK_DEBIAN_<COMPONENT>_PACKAGE_SOURCE
871 New in version 3.5.
872
873
874 Sets the Source field of the binary Debian package. When the
875 binary package name is not the same as the source package name
876 (in particular when several components/binaries are generated
877 from one source) the source from which the binary has been gen‐
878 erated should be indicated with the field Source.
879
880 • Mandatory : NO
881
882 • Default :
883
884 • An empty string for non-component based installations
885
886 • CPACK_DEBIAN_PACKAGE_SOURCE for component-based installa‐
887 tions.
888
889 See
890 https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
891
892 NOTE:
893 This value is not interpreted. It is possible to pass an op‐
894 tional revision number of the referenced source package as
895 well.
896
897 Packaging of debug information
898 New in version 3.13.
899
900
901 Dbgsym packages contain debug symbols for debugging packaged binaries.
902
903 Dbgsym packaging has its own set of variables:
904
905 CPACK_DEBIAN_DEBUGINFO_PACKAGE
906
907 CPACK_DEBIAN_<component>_DEBUGINFO_PACKAGE
908 Enable generation of dbgsym .ddeb package(s).
909
910 • Mandatory : NO
911
912 • Default : OFF
913
914 NOTE:
915 Setting this also strips the ELF files in the generated non-dbgsym
916 package, which results in debuginfo only being available in the
917 dbgsym package.
918
919 NOTE:
920 Binaries must contain debug symbols before packaging so use either
921 Debug or RelWithDebInfo for CMAKE_BUILD_TYPE variable value.
922
923 Additionally, if CPACK_STRIP_FILES is set, the files will be
924 stripped before they get to the DEB generator, so will not contain
925 debug symbols and a dbgsym package will not get built. Do not use
926 with CPACK_STRIP_FILES.
927
928 Building Debian packages on Windows
929 New in version 3.10.
930
931
932 To communicate UNIX file permissions from the install stage to the
933 CPack DEB generator the "cmake_mode_t" NTFS alternate data stream (ADT)
934 is used.
935
936 When a filesystem without ADT support is used only owner read/write
937 permissions can be preserved.
938
939 Reproducible packages
940 New in version 3.13.
941
942
943 The environment variable SOURCE_DATE_EPOCH may be set to a UNIX time‐
944 stamp, defined as the number of seconds, excluding leap seconds, since
945 01 Jan 1970 00:00:00 UTC. If set, the CPack DEB generator will use its
946 value for timestamps in the package.
947
948 CPack DragNDrop Generator
949 The DragNDrop CPack generator (macOS) creates a DMG image.
950
951 Variables specific to CPack DragNDrop generator
952 The following variables are specific to the DragNDrop installers built
953 on macOS:
954
955 CPACK_DMG_VOLUME_NAME
956 The volume name of the generated disk image. Defaults to
957 CPACK_PACKAGE_FILE_NAME.
958
959 CPACK_DMG_FORMAT
960 The disk image format. Common values are UDRO (UDIF read-only),
961 UDZO (UDIF zlib-compressed) or UDBZ (UDIF bzip2-compressed). Re‐
962 fer to hdiutil(1) for more information on other available for‐
963 mats. Defaults to UDZO.
964
965 CPACK_DMG_DS_STORE
966 Path to a custom .DS_Store file. This .DS_Store file can be used
967 to specify the Finder window position/geometry and layout (such
968 as hidden toolbars, placement of the icons etc.). This file has
969 to be generated by the Finder (either manually or through Apple‐
970 Script) using a normal folder from which the .DS_Store file can
971 then be extracted.
972
973 CPACK_DMG_DS_STORE_SETUP_SCRIPT
974 New in version 3.5.
975
976
977 Path to a custom AppleScript file. This AppleScript is used to
978 generate a .DS_Store file which specifies the Finder window po‐
979 sition/geometry and layout (such as hidden toolbars, placement
980 of the icons etc.). By specifying a custom AppleScript there is
981 no need to use CPACK_DMG_DS_STORE, as the .DS_Store that is gen‐
982 erated by the AppleScript will be packaged.
983
984 CPACK_DMG_BACKGROUND_IMAGE
985 Path to an image file to be used as the background. This file
986 will be copied to .background/background.<ext>, where <ext> is
987 the original image file extension. The background image is in‐
988 stalled into the image before CPACK_DMG_DS_STORE_SETUP_SCRIPT is
989 executed or CPACK_DMG_DS_STORE is installed. By default no
990 background image is set.
991
992 CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK
993 New in version 3.6.
994
995
996 Default behavior is to include a symlink to /Applications in the
997 DMG. Set this option to ON to avoid adding the symlink.
998
999 CPACK_DMG_SLA_DIR
1000 New in version 3.5.
1001
1002
1003 Directory where license and menu files for different languages
1004 are stored. Setting this causes CPack to look for a <lan‐
1005 guage>.menu.txt and <language>.license.txt or <language>.li‐
1006 cense.rtf file for every language defined in CPACK_DMG_SLA_LAN‐
1007 GUAGES. If both this variable and CPACK_RESOURCE_FILE_LICENSE
1008 are set, CPack will only look for the menu files and use the
1009 same license file for all languages. If both <language>.li‐
1010 cense.txt and <language>.license.rtf exist, the .txt file will
1011 be used.
1012
1013 New in version 3.17: RTF support.
1014
1015
1016 CPACK_DMG_SLA_LANGUAGES
1017 New in version 3.5.
1018
1019
1020 Languages for which a license agreement is provided when mount‐
1021 ing the generated DMG. A menu file consists of 9 lines of text.
1022 The first line is is the name of the language itself, uppercase,
1023 in English (e.g. German). The other lines are translations of
1024 the following strings:
1025
1026 • Agree
1027
1028 • Disagree
1029
1030 • Print
1031
1032 • Save...
1033
1034 • You agree to the terms of the License Agreement when you click
1035 the "Agree" button.
1036
1037 • Software License Agreement
1038
1039 • This text cannot be saved. The disk may be full or locked, or
1040 the file may be locked.
1041
1042 • Unable to print. Make sure you have selected a printer.
1043
1044 For every language in this list, CPack will try to find files
1045 <language>.menu.txt and <language>.license.txt in the directory
1046 specified by the CPACK_DMG_SLA_DIR variable.
1047
1048 CPACK_DMG_<component>_FILE_NAME
1049 New in version 3.17.
1050
1051
1052 File name when packaging <component> as its own DMG (CPACK_COM‐
1053 PONENTS_GROUPING set to IGNORE).
1054
1055 • Default: CPACK_PACKAGE_FILE_NAME-<component>
1056
1057 CPACK_DMG_FILESYSTEM
1058 New in version 3.21.
1059
1060
1061 The filesystem format. Common values are APFS and HFS+. See man
1062 hdiutil for a full list of supported formats. Defaults to HFS+.
1063
1064 CPACK_COMMAND_HDIUTIL
1065 Path to the hdiutil(1) command used to operate on disk image
1066 files on macOS. This variable can be used to override the auto‐
1067 matically detected command (or specify its location if the
1068 auto-detection fails to find it).
1069
1070 CPACK_COMMAND_SETFILE
1071 Path to the SetFile(1) command used to set extended attributes
1072 on files and directories on macOS. This variable can be used to
1073 override the automatically detected command (or specify its lo‐
1074 cation if the auto-detection fails to find it).
1075
1076 CPACK_COMMAND_REZ
1077 Path to the Rez(1) command used to compile resources on macOS.
1078 This variable can be used to override the automatically detected
1079 command (or specify its location if the auto-detection fails to
1080 find it).
1081
1082 CPack External Generator
1083 New in version 3.13.
1084
1085
1086 CPack provides many generators to create packages for a variety of
1087 platforms and packaging systems. The intention is for CMake/CPack to be
1088 a complete end-to-end solution for building and packaging a software
1089 project. However, it may not always be possible to use CPack for the
1090 entire packaging process, due to either technical limitations or poli‐
1091 cies that require the use of certain tools. For this reason, CPack pro‐
1092 vides the "External" generator, which allows external packaging soft‐
1093 ware to take advantage of some of the functionality provided by CPack,
1094 such as component installation and the dependency graph.
1095
1096 Integration with External Packaging Tools
1097 The CPack External generator generates a .json file containing the
1098 CPack internal metadata, which gives external software information on
1099 how to package the software. External packaging software may itself in‐
1100 voke CPack, consume the generated metadata, install and package files
1101 as required.
1102
1103 Alternatively CPack can invoke an external packaging software through
1104 an optional custom CMake script in CPACK_EXTERNAL_PACKAGE_SCRIPT in‐
1105 stead.
1106
1107 Staging of installation files may also optionally be taken care of by
1108 the generator when enabled through the CPACK_EXTERNAL_ENABLE_STAGING
1109 variable.
1110
1111 JSON Format
1112 The JSON metadata file contains a list of CPack components and compo‐
1113 nent groups, the various options passed to cpack_add_component() and
1114 cpack_add_component_group(), the dependencies between the components
1115 and component groups, and various other options passed to CPack.
1116
1117 The JSON's root object will always provide two fields: formatVersionMa‐
1118 jor and formatVersionMinor, which are always integers that describe the
1119 output format of the generator. Backwards-compatible changes to the
1120 output format (for example, adding a new field that didn't exist be‐
1121 fore) cause the minor version to be incremented, and backwards-incom‐
1122 patible changes (for example, deleting a field or changing its meaning)
1123 cause the major version to be incremented and the minor version reset
1124 to 0. The format version is always of the format major.minor. In other
1125 words, it always has exactly two parts, separated by a period.
1126
1127 You can request one or more specific versions of the output format as
1128 described below with CPACK_EXTERNAL_REQUESTED_VERSIONS. The output for‐
1129 mat will have a major version that exactly matches the requested major
1130 version, and a minor version that is greater than or equal to the re‐
1131 quested minor version. If no version is requested with
1132 CPACK_EXTERNAL_REQUESTED_VERSIONS, the latest known major version is
1133 used by default. Currently, the only supported format is 1.0, which is
1134 described below.
1135
1136 Version 1.0
1137 In addition to the standard format fields, format version 1.0 provides
1138 the following fields in the root:
1139
1140 components
1141 The components field is an object with component names as the
1142 keys and objects describing the components as the values. The
1143 component objects have the following fields:
1144
1145 name The name of the component. This is always the same as the
1146 key in the components object.
1147
1148 displayName
1149 The value of the DISPLAY_NAME field passed to
1150 cpack_add_component().
1151
1152 description
1153 The value of the DESCRIPTION field passed to
1154 cpack_add_component().
1155
1156 isHidden
1157 True if HIDDEN was passed to cpack_add_component(), false
1158 if it was not.
1159
1160 isRequired
1161 True if REQUIRED was passed to cpack_add_component(),
1162 false if it was not.
1163
1164 isDisabledByDefault
1165 True if DISABLED was passed to cpack_add_component(),
1166 false if it was not.
1167
1168 group Only present if GROUP was passed to cpack_add_compo‐
1169 nent(). If so, this field is a string value containing
1170 the component's group.
1171
1172 dependencies
1173 An array of components the component depends on. This
1174 contains the values in the DEPENDS argument passed to
1175 cpack_add_component(). If no DEPENDS argument was passed,
1176 this is an empty list.
1177
1178 installationTypes
1179 An array of installation types the component is part of.
1180 This contains the values in the INSTALL_TYPES argument
1181 passed to cpack_add_component(). If no INSTALL_TYPES ar‐
1182 gument was passed, this is an empty list.
1183
1184 isDownloaded
1185 True if DOWNLOADED was passed to cpack_add_component(),
1186 false if it was not.
1187
1188 archiveFile
1189 The name of the archive file passed with the ARCHIVE_FILE
1190 argument to cpack_add_component(). If no ARCHIVE_FILE ar‐
1191 gument was passed, this is an empty string.
1192
1193 componentGroups
1194 The componentGroups field is an object with component group
1195 names as the keys and objects describing the component groups as
1196 the values. The component group objects have the following
1197 fields:
1198
1199 name The name of the component group. This is always the same
1200 as the key in the componentGroups object.
1201
1202 displayName
1203 The value of the DISPLAY_NAME field passed to
1204 cpack_add_component_group().
1205
1206 description
1207 The value of the DESCRIPTION field passed to
1208 cpack_add_component_group().
1209
1210 parentGroup
1211 Only present if PARENT_GROUP was passed to cpack_add_com‐
1212 ponent_group(). If so, this field is a string value con‐
1213 taining the component group's parent group.
1214
1215 isExpandedByDefault
1216 True if EXPANDED was passed to cpack_add_compo‐
1217 nent_group(), false if it was not.
1218
1219 isBold True if BOLD_TITLE was passed to cpack_add_compo‐
1220 nent_group(), false if it was not.
1221
1222 components
1223 An array of names of components that are direct members
1224 of the group (components that have this group as their
1225 GROUP). Components of subgroups are not included.
1226
1227 subgroups
1228 An array of names of component groups that are subgroups
1229 of the group (groups that have this group as their PAR‐
1230 ENT_GROUP).
1231
1232 installationTypes
1233 The installationTypes field is an object with installation type
1234 names as the keys and objects describing the installation types
1235 as the values. The installation type objects have the following
1236 fields:
1237
1238 name The name of the installation type. This is always the
1239 same as the key in the installationTypes object.
1240
1241 displayName
1242 The value of the DISPLAY_NAME field passed to
1243 cpack_add_install_type().
1244
1245 index The integer index of the installation type in the list.
1246
1247 projects
1248 The projects field is an array of objects describing CMake
1249 projects which comprise the CPack project. The values in this
1250 field are derived from CPACK_INSTALL_CMAKE_PROJECTS. In most
1251 cases, this will be only a single project. The project objects
1252 have the following fields:
1253
1254 projectName
1255 The project name passed to CPACK_INSTALL_CMAKE_PROJECTS.
1256
1257 component
1258 The name of the component or component set which com‐
1259 prises the project.
1260
1261 directory
1262 The build directory of the CMake project. This is the di‐
1263 rectory which contains the cmake_install.cmake script.
1264
1265 subDirectory
1266 The subdirectory to install the project into inside the
1267 CPack package.
1268
1269 packageName
1270 The package name given in CPACK_PACKAGE_NAME. Only present if
1271 this option is set.
1272
1273 packageVersion
1274 The package version given in CPACK_PACKAGE_VERSION. Only present
1275 if this option is set.
1276
1277 packageDescriptionFile
1278 The package description file given in CPACK_PACKAGE_DESCRIP‐
1279 TION_FILE. Only present if this option is set.
1280
1281 packageDescriptionSummary
1282 The package description summary given in CPACK_PACKAGE_DESCRIP‐
1283 TION_SUMMARY. Only present if this option is set.
1284
1285 buildConfig
1286 The build configuration given to CPack with the -C option. Only
1287 present if this option is set.
1288
1289 defaultDirectoryPermissions
1290 The default directory permissions given in CPACK_INSTALL_DE‐
1291 FAULT_DIRECTORY_PERMISSIONS. Only present if this option is set.
1292
1293 setDestdir
1294 True if CPACK_SET_DESTDIR is true, false if it is not.
1295
1296 packagingInstallPrefix
1297 The install prefix given in CPACK_PACKAGING_INSTALL_PREFIX. Only
1298 present if CPACK_SET_DESTDIR is true.
1299
1300 stripFiles
1301 True if CPACK_STRIP_FILES is true, false if it is not.
1302
1303 warnOnAbsoluteInstallDestination
1304 True if CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION is true,
1305 false if it is not.
1306
1307 errorOnAbsoluteInstallDestination
1308 True if CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION is true,
1309 false if it is not.
1310
1311 Variables specific to CPack External generator
1312 CPACK_EXTERNAL_REQUESTED_VERSIONS
1313 This variable is used to request a specific version of the CPack
1314 External generator. It is a list of major.minor values, sepa‐
1315 rated by semicolons.
1316
1317 If this variable is set to a non-empty value, the CPack External
1318 generator will iterate through each item in the list to search
1319 for a version that it knows how to generate. Requested versions
1320 should be listed in order of descending preference by the client
1321 software, as the first matching version in the list will be gen‐
1322 erated.
1323
1324 The generator knows how to generate the version if it has a ver‐
1325 sioned generator whose major version exactly matches the re‐
1326 quested major version, and whose minor version is greater than
1327 or equal to the requested minor version. For example, if
1328 CPACK_EXTERNAL_REQUESTED_VERSIONS contains 1.0, and the CPack
1329 External generator knows how to generate 1.1, it will generate
1330 1.1. If the generator doesn't know how to generate a version in
1331 the list, it skips the version and looks at the next one. If it
1332 doesn't know how to generate any of the requested versions, an
1333 error is thrown.
1334
1335 If this variable is not set, or is empty, the CPack External
1336 generator will generate the highest major and minor version that
1337 it knows how to generate.
1338
1339 If an invalid version is encountered in CPACK_EXTERNAL_RE‐
1340 QUESTED_VERSIONS (one that doesn't match major.minor, where ma‐
1341 jor and minor are integers), it is ignored.
1342
1343 CPACK_EXTERNAL_ENABLE_STAGING
1344 This variable can be set to true to enable optional installation
1345 into a temporary staging area which can then be picked up and
1346 packaged by an external packaging tool. The top level directory
1347 used by CPack for the current packaging task is contained in
1348 CPACK_TOPLEVEL_DIRECTORY. It is automatically cleaned up on
1349 each run before packaging is initiated and can be used for cus‐
1350 tom temporary files required by the external packaging tool. It
1351 also contains the staging area CPACK_TEMPORARY_DIRECTORY into
1352 which CPack performs the installation when staging is enabled.
1353
1354 CPACK_EXTERNAL_PACKAGE_SCRIPT
1355 This variable can optionally specify the full path to a CMake
1356 script file to be run as part of the CPack invocation. It is
1357 invoked after (optional) staging took place and may run an ex‐
1358 ternal packaging tool. The script has access to the variables
1359 defined by the CPack config file.
1360
1361 CPACK_EXTERNAL_BUILT_PACKAGES
1362 New in version 3.19.
1363
1364
1365 The CPACK_EXTERNAL_PACKAGE_SCRIPT script may set this list vari‐
1366 able to the full paths of generated package files. CPack will
1367 copy these files from the staging directory back to the top
1368 build directory and possibly produce checksum files if the
1369 CPACK_PACKAGE_CHECKSUM is set.
1370
1371 CPack FreeBSD Generator
1372 New in version 3.10.
1373
1374
1375 The built in (binary) CPack FreeBSD (pkg) generator (Unix only)
1376
1377 Variables affecting the CPack FreeBSD (pkg) generator
1378 • New in version 3.18: CPACK_ARCHIVE_THREADS
1379
1380
1381 Variables specific to CPack FreeBSD (pkg) generator
1382 The CPack FreeBSD generator may be used to create pkg(8) packages --
1383 these may be used on FreeBSD, DragonflyBSD, NetBSD, OpenBSD, but also
1384 on Linux or OSX, depending on the installed package-management tools --
1385 using CPack.
1386
1387 The CPack FreeBSD generator is a CPack generator and uses the CPACK_XXX
1388 variables used by CPack. It tries to re-use packaging information that
1389 may already be specified for Debian packages for the CPack DEB Genera‐
1390 tor. It also tries to re-use RPM packaging information when Debian does
1391 not specify.
1392
1393 The CPack FreeBSD generator should work on any host with libpkg in‐
1394 stalled. The packages it produces are specific to the host architecture
1395 and ABI.
1396
1397 The CPack FreeBSD generator sets package-metadata through CPACK_FREE‐
1398 BSD_XXX variables. The CPack FreeBSD generator, unlike the CPack Deb
1399 generator, does not specially support componentized packages; a single
1400 package is created from all the software artifacts created through
1401 CMake.
1402
1403 All of the variables can be set specifically for FreeBSD packaging in
1404 the CPackConfig file or in CMakeLists.txt, but most of them have de‐
1405 faults that use general settings (e.g. CMAKE_PROJECT_NAME) or De‐
1406 bian-specific variables when those make sense (e.g. the homepage of an
1407 upstream project is usually unchanged by the flavor of packaging). When
1408 there is no Debian information to fall back on, but the RPM packaging
1409 has it, fall back to the RPM information (e.g. package license).
1410
1411 CPACK_FREEBSD_PACKAGE_NAME
1412 Sets the package name (in the package manifest, but also affects
1413 the output filename).
1414
1415 • Mandatory: YES
1416
1417 • Default:
1418
1419 • CPACK_PACKAGE_NAME (this is always set by CPack itself,
1420 based on CMAKE_PROJECT_NAME).
1421
1422 CPACK_FREEBSD_PACKAGE_COMMENT
1423 Sets the package comment. This is the short description dis‐
1424 played by pkg(8) in standard "pkg info" output.
1425
1426 • Mandatory: YES
1427
1428 • Default:
1429
1430 • CPACK_PACKAGE_DESCRIPTION_SUMMARY (this is always set by
1431 CPack itself, if nothing else sets it explicitly).
1432
1433 • PROJECT_DESCRIPTION (this can be set with the DESCRIPTION
1434 parameter for project()).
1435
1436 CPACK_FREEBSD_PACKAGE_DESCRIPTION
1437 Sets the package description. This is the long description of
1438 the package, given by "pkg info" with a specific package as ar‐
1439 gument.
1440
1441 • Mandatory: YES
1442
1443 • Default:
1444
1445 • CPACK_DEBIAN_PACKAGE_DESCRIPTION (this may be set already
1446 for Debian packaging, so it is used as a fallback).
1447
1448 CPACK_FREEBSD_PACKAGE_WWW
1449 The URL of the web site for this package, preferably (when ap‐
1450 plicable) the site from which the original source can be ob‐
1451 tained and any additional upstream documentation or information
1452 may be found.
1453
1454 • Mandatory: YES
1455
1456 • Default:
1457
1458 • CMAKE_PROJECT_HOMEPAGE_URL, or if that is not set,
1459 CPACK_DEBIAN_PACKAGE_HOMEPAGE (this may be set already for
1460 Debian packaging, so it is used as a fallback).
1461
1462 New in version 3.12: The CMAKE_PROJECT_HOMEPAGE_URL variable.
1463
1464
1465 CPACK_FREEBSD_PACKAGE_LICENSE
1466 The license, or licenses, which apply to this software package.
1467 This must be one or more license-identifiers that pkg recognizes
1468 as acceptable license identifiers (e.g. "GPLv2").
1469
1470 • Mandatory: YES
1471
1472 • Default:
1473
1474 • CPACK_RPM_PACKAGE_LICENSE
1475
1476 CPACK_FREEBSD_PACKAGE_LICENSE_LOGIC
1477 This variable is only of importance if there is more than one
1478 license. The default is "single", which is only applicable to a
1479 single license. Other acceptable values are determined by pkg
1480 -- those are "dual" or "multi" -- meaning choice (OR) or simul‐
1481 taneous (AND) application of the licenses.
1482
1483 • Mandatory: NO
1484
1485 • Default: single
1486
1487 CPACK_FREEBSD_PACKAGE_MAINTAINER
1488 The FreeBSD maintainer (e.g. kde@freebsd.org) of this package.
1489
1490 • Mandatory: YES
1491
1492 • Default: none
1493
1494 CPACK_FREEBSD_PACKAGE_ORIGIN
1495 The origin (ports label) of this package; for packages built by
1496 CPack outside of the ports system this is of less importance.
1497 The default puts the package somewhere under misc/, as a stop‐
1498 gap.
1499
1500 • Mandatory: YES
1501
1502 • Default: misc/<package name>
1503
1504 CPACK_FREEBSD_PACKAGE_CATEGORIES
1505 The ports categories where this package lives (if it were to be
1506 built from ports). If none is set a single category is deter‐
1507 mined based on the package origin.
1508
1509 • Mandatory: YES
1510
1511 • Default: derived from ORIGIN
1512
1513 CPACK_FREEBSD_PACKAGE_DEPS
1514 A list of package origins that should be added as package depen‐
1515 dencies. These are in the form <category>/<packagename>, e.g.
1516 x11/libkonq. No version information needs to be provided (this
1517 is not included in the manifest).
1518
1519 • Mandatory: NO
1520
1521 • Default: empty
1522
1523 CPack IFW Generator
1524 New in version 3.1.
1525
1526
1527 Configure and run the Qt Installer Framework to generate a Qt in‐
1528 staller.
1529
1530 Overview
1531 This cpack generator generates configuration and meta information for
1532 the Qt Installer Framework (QtIFW), and runs QtIFW tools to generate a
1533 Qt installer.
1534
1535 QtIFW provides tools and utilities to create installers for the plat‐
1536 forms supported by Qt: Linux, Microsoft Windows, and macOS.
1537
1538 To make use of this generator, QtIFW needs to be installed. The CPack‐
1539 IFW module looks for the location of the QtIFW command-line utilities,
1540 and defines several commands to control the behavior of this generator.
1541
1542 Variables
1543 You can use the following variables to change behavior of CPack IFW
1544 generator.
1545
1546 Debug
1547 CPACK_IFW_VERBOSE
1548 New in version 3.3.
1549
1550
1551 Set to ON to enable addition debug output. By default is OFF.
1552
1553 Package
1554 CPACK_IFW_PACKAGE_TITLE
1555 Name of the installer as displayed on the title bar. By default
1556 used CPACK_PACKAGE_DESCRIPTION_SUMMARY.
1557
1558 CPACK_IFW_PACKAGE_PUBLISHER
1559 Publisher of the software (as shown in the Windows Control
1560 Panel). By default used CPACK_PACKAGE_VENDOR.
1561
1562 CPACK_IFW_PRODUCT_URL
1563 URL to a page that contains product information on your web
1564 site.
1565
1566 CPACK_IFW_PACKAGE_ICON
1567 Filename for a custom installer icon. The actual file is '.icns'
1568 (macOS), '.ico' (Windows). No functionality on Unix.
1569
1570 CPACK_IFW_PACKAGE_WINDOW_ICON
1571 Filename for a custom window icon in PNG format for the In‐
1572 staller application.
1573
1574 CPACK_IFW_PACKAGE_LOGO
1575 Filename for a logo is used as QWizard::LogoPixmap.
1576
1577 CPACK_IFW_PACKAGE_WATERMARK
1578 New in version 3.8.
1579
1580
1581 Filename for a watermark is used as QWizard::WatermarkPixmap.
1582
1583 CPACK_IFW_PACKAGE_BANNER
1584 New in version 3.8.
1585
1586
1587 Filename for a banner is used as QWizard::BannerPixmap.
1588
1589 CPACK_IFW_PACKAGE_BACKGROUND
1590 New in version 3.8.
1591
1592
1593 Filename for an image used as QWizard::BackgroundPixmap (only
1594 used by MacStyle).
1595
1596 CPACK_IFW_PACKAGE_WIZARD_STYLE
1597 New in version 3.8.
1598
1599
1600 Wizard style to be used ("Modern", "Mac", "Aero" or "Classic").
1601
1602 CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
1603 New in version 3.8.
1604
1605
1606 Default width of the wizard in pixels. Setting a banner image
1607 will override this.
1608
1609 CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
1610 New in version 3.8.
1611
1612
1613 Default height of the wizard in pixels. Setting a watermark im‐
1614 age will override this.
1615
1616 CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST
1617 New in version 3.20.
1618
1619
1620 Set to OFF if the widget listing installer pages on the left
1621 side of the wizard should not be shown.
1622
1623 It is ON by default, but will only have an effect if using QtIFW
1624 4.0 or later.
1625
1626 CPACK_IFW_PACKAGE_TITLE_COLOR
1627 New in version 3.8.
1628
1629
1630 Color of the titles and subtitles (takes an HTML color code,
1631 such as "#88FF33").
1632
1633 CPACK_IFW_PACKAGE_STYLE_SHEET
1634 New in version 3.15.
1635
1636
1637 Filename for a stylesheet.
1638
1639 CPACK_IFW_TARGET_DIRECTORY
1640 Default target directory for installation. By default used
1641 "@ApplicationsDir@/CPACK_PACKAGE_INSTALL_DIRECTORY" (variables
1642 embedded in '@' are expanded by the QtIFW scripting engine).
1643
1644 You can use predefined variables.
1645
1646 CPACK_IFW_ADMIN_TARGET_DIRECTORY
1647 Default target directory for installation with administrator
1648 rights.
1649
1650 You can use predefined variables.
1651
1652 CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR
1653 New in version 3.11.
1654
1655
1656 Set to OFF if the target directory should not be deleted when
1657 uninstalling.
1658
1659 Is ON by default
1660
1661 CPACK_IFW_PACKAGE_GROUP
1662 The group, which will be used to configure the root package
1663
1664 CPACK_IFW_PACKAGE_NAME
1665 The root package name, which will be used if configuration group
1666 is not specified
1667
1668 CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
1669 New in version 3.3.
1670
1671
1672 Name of the default program group for the product in the Windows
1673 Start menu.
1674
1675 By default used CPACK_IFW_PACKAGE_NAME.
1676
1677 CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
1678 New in version 3.3.
1679
1680
1681 Filename of the generated maintenance tool. The platform-spe‐
1682 cific executable file extension is appended.
1683
1684 By default used QtIFW defaults (maintenancetool).
1685
1686 CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
1687 New in version 3.3.
1688
1689
1690 Filename for the configuration of the generated maintenance
1691 tool.
1692
1693 By default used QtIFW defaults (maintenancetool.ini).
1694
1695 CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
1696 New in version 3.3.
1697
1698
1699 Set to ON if the installation path can contain non-ASCII charac‐
1700 ters.
1701
1702 Is ON for QtIFW less 2.0 tools.
1703
1704 CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
1705 New in version 3.3.
1706
1707
1708 Set to OFF if the installation path cannot contain space charac‐
1709 ters.
1710
1711 Is ON for QtIFW less 2.0 tools.
1712
1713 CPACK_IFW_PACKAGE_CONTROL_SCRIPT
1714 New in version 3.3.
1715
1716
1717 Filename for a custom installer control script.
1718
1719 CPACK_IFW_PACKAGE_RESOURCES
1720 New in version 3.7.
1721
1722
1723 List of additional resources ('.qrc' files) to include in the
1724 installer binary.
1725
1726 You can use cpack_ifw_add_package_resources() command to resolve
1727 relative paths.
1728
1729 CPACK_IFW_PACKAGE_FILE_EXTENSION
1730 New in version 3.10.
1731
1732
1733 The target binary extension.
1734
1735 On Linux, the name of the target binary is automatically ex‐
1736 tended with '.run', if you do not specify the extension.
1737
1738 On Windows, the target is created as an application with the ex‐
1739 tension '.exe', which is automatically added, if not supplied.
1740
1741 On Mac, the target is created as an DMG disk image with the ex‐
1742 tension '.dmg', which is automatically added, if not supplied.
1743
1744 CPACK_IFW_REPOSITORIES_ALL
1745 The list of remote repositories.
1746
1747 The default value of this variable is computed by CPack and con‐
1748 tains all repositories added with command cpack_ifw_add_reposi‐
1749 tory() or updated with command cpack_ifw_update_repository().
1750
1751 CPACK_IFW_DOWNLOAD_ALL
1752 If this is ON all components will be downloaded. By default is
1753 OFF or used value from CPACK_DOWNLOAD_ALL if set
1754
1755 Components
1756 CPACK_IFW_RESOLVE_DUPLICATE_NAMES
1757 Resolve duplicate names when installing components with groups.
1758
1759 CPACK_IFW_PACKAGES_DIRECTORIES
1760 Additional prepared packages dirs that will be used to resolve
1761 dependent components.
1762
1763 CPACK_IFW_REPOSITORIES_DIRECTORIES
1764 New in version 3.10.
1765
1766
1767 Additional prepared repository dirs that will be used to resolve
1768 and repack dependent components. This feature available only
1769 since QtIFW 3.1.
1770
1771 QtIFW Tools
1772 CPACK_IFW_FRAMEWORK_VERSION
1773 New in version 3.3.
1774
1775
1776 The version of used QtIFW tools.
1777
1778 The following variables provide the locations of the QtIFW command-line
1779 tools as discovered by the module CPackIFW. These variables are
1780 cached, and may be configured if needed.
1781
1782 CPACK_IFW_ARCHIVEGEN_EXECUTABLE
1783 New in version 3.19.
1784
1785
1786 The path to archivegen.
1787
1788 CPACK_IFW_BINARYCREATOR_EXECUTABLE
1789 The path to binarycreator.
1790
1791 CPACK_IFW_REPOGEN_EXECUTABLE
1792 The path to repogen.
1793
1794 CPACK_IFW_INSTALLERBASE_EXECUTABLE
1795 The path to installerbase.
1796
1797 CPACK_IFW_DEVTOOL_EXECUTABLE
1798 The path to devtool.
1799
1800 Hints for Finding QtIFW
1801 Generally, the CPack IFW generator automatically finds QtIFW tools, but
1802 if you don't use a default path for installation of the QtIFW tools,
1803 the path may be specified in either a CMake or an environment variable:
1804
1805 CPACK_IFW_ROOT
1806 New in version 3.9.
1807
1808
1809 An CMake variable which specifies the location of the QtIFW tool
1810 suite.
1811
1812 The variable will be cached in the CPackConfig.cmake file and
1813 used at CPack runtime.
1814
1815 QTIFWDIR
1816 An environment variable which specifies the location of the
1817 QtIFW tool suite.
1818
1819 NOTE:
1820 The specified path should not contain "bin" at the end (for example:
1821 "D:\DevTools\QtIFW2.0.5").
1822
1823 The CPACK_IFW_ROOT variable has a higher priority and overrides the
1824 value of the QTIFWDIR variable.
1825
1826 Other Settings
1827 Online installer
1828 By default, this generator generates an offline installer. This means
1829 that that all packaged files are fully contained in the installer exe‐
1830 cutable.
1831
1832 In contrast, an online installer will download some or all components
1833 from a remote server.
1834
1835 The DOWNLOADED option in the cpack_add_component() command specifies
1836 that a component is to be downloaded. Alternatively, the ALL option in
1837 the cpack_configure_downloads() command specifies that all components
1838 are to be be downloaded.
1839
1840 The cpack_ifw_add_repository() command and the CPACK_IFW_DOWNLOAD_ALL
1841 variable allow for more specific configuration.
1842
1843 When there are online components, CPack will write them to archive
1844 files. The help page of the CPackComponent module, especially the sec‐
1845 tion on the cpack_configure_downloads() function, explains how to make
1846 these files accessible from a download URL.
1847
1848 Internationalization
1849 New in version 3.9.
1850
1851
1852 Some variables and command arguments support internationalization via
1853 CMake script. This is an optional feature.
1854
1855 Installers created by QtIFW tools have built-in support for interna‐
1856 tionalization and many phrases are localized to many languages, but
1857 this does not apply to the description of the your components and
1858 groups that will be distributed.
1859
1860 Localization of the description of your components and groups is useful
1861 for users of your installers.
1862
1863 A localized variable or argument can contain a single default value,
1864 and a set of pairs the name of the locale and the localized value.
1865
1866 For example:
1867
1868 set(LOCALIZABLE_VARIABLE "Default value"
1869 en "English value"
1870 en_US "American value"
1871 en_GB "Great Britain value"
1872 )
1873
1874 See Also
1875 Qt Installer Framework Manual:
1876
1877 • Index page: http://doc.qt.io/qtinstallerframework/index.html
1878
1879 • Component Scripting:
1880 http://doc.qt.io/qtinstallerframework/scripting.html
1881
1882 • Predefined Variables:
1883 http://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables
1884
1885 • Promoting Updates:
1886 http://doc.qt.io/qtinstallerframework/ifw-updates.html
1887
1888 Download Qt Installer Framework for your platform from Qt site:
1889 http://download.qt.io/official_releases/qt-installer-framework
1890
1891 CPack NSIS Generator
1892 CPack Nullsoft Scriptable Install System (NSIS) generator specific op‐
1893 tions.
1894
1895 Changed in version 3.22: The NSIS generator requires NSIS 3.03 or
1896 newer.
1897
1898
1899 Variables specific to CPack NSIS generator
1900 The following variables are specific to the graphical installers built
1901 on Windows Nullsoft Scriptable Install System.
1902
1903 CPACK_NSIS_INSTALL_ROOT
1904 The default installation directory presented to the end user by
1905 the NSIS installer is under this root dir. The full directory
1906 presented to the end user is: ${CPACK_NSIS_IN‐
1907 STALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
1908
1909 CPACK_NSIS_MUI_ICON
1910 An icon filename. The name of a *.ico file used as the main
1911 icon for the generated install program.
1912
1913 CPACK_NSIS_MUI_UNIICON
1914 An icon filename. The name of a *.ico file used as the main
1915 icon for the generated uninstall program.
1916
1917 CPACK_NSIS_INSTALLER_MUI_ICON_CODE
1918 undocumented.
1919
1920 CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP
1921 New in version 3.5.
1922
1923
1924 The filename of a bitmap to use as the NSIS MUI_WELCOMEFINISH‐
1925 PAGE_BITMAP.
1926
1927 CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP
1928 New in version 3.5.
1929
1930
1931 The filename of a bitmap to use as the NSIS MUI_UNWELCOMEFINISH‐
1932 PAGE_BITMAP.
1933
1934 CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS
1935 Extra NSIS commands that will be added to the beginning of the
1936 install Section, before your install tree is available on the
1937 target system.
1938
1939 CPACK_NSIS_EXTRA_INSTALL_COMMANDS
1940 Extra NSIS commands that will be added to the end of the install
1941 Section, after your install tree is available on the target sys‐
1942 tem.
1943
1944 CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
1945 Extra NSIS commands that will be added to the uninstall Section,
1946 before your install tree is removed from the target system.
1947
1948 CPACK_NSIS_COMPRESSOR
1949 The arguments that will be passed to the NSIS SetCompressor com‐
1950 mand.
1951
1952 CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL
1953 Ask about uninstalling previous versions first. If this is set
1954 to ON, then an installer will look for previous installed ver‐
1955 sions and if one is found, ask the user whether to uninstall it
1956 before proceeding with the install.
1957
1958 CPACK_NSIS_MODIFY_PATH
1959 Modify PATH toggle. If this is set to ON, then an extra page
1960 will appear in the installer that will allow the user to choose
1961 whether the program directory should be added to the system PATH
1962 variable.
1963
1964 CPACK_NSIS_DISPLAY_NAME
1965 The display name string that appears in the Windows Apps & fea‐
1966 tures in Control Panel
1967
1968 CPACK_NSIS_PACKAGE_NAME
1969 The title displayed at the top of the installer.
1970
1971 CPACK_NSIS_INSTALLED_ICON_NAME
1972 A path to the executable that contains the installer icon.
1973
1974 CPACK_NSIS_HELP_LINK
1975 URL to a web site providing assistance in installing your appli‐
1976 cation.
1977
1978 CPACK_NSIS_URL_INFO_ABOUT
1979 URL to a web site providing more information about your applica‐
1980 tion.
1981
1982 CPACK_NSIS_CONTACT
1983 Contact information for questions and comments about the instal‐
1984 lation process.
1985
1986 CPACK_NSIS_<compName>_INSTALL_DIRECTORY
1987 New in version 3.7.
1988
1989
1990 Custom install directory for the specified component <compName>
1991 instead of $INSTDIR.
1992
1993 CPACK_NSIS_CREATE_ICONS_EXTRA
1994 Additional NSIS commands for creating Start Menu shortcuts.
1995
1996 CPACK_NSIS_DELETE_ICONS_EXTRA
1997 Additional NSIS commands to uninstall Start Menu shortcuts.
1998
1999 CPACK_NSIS_EXECUTABLES_DIRECTORY
2000 Creating NSIS Start Menu links assumes that they are in bin un‐
2001 less this variable is set. For example, you would set this to
2002 exec if your executables are in an exec directory.
2003
2004 CPACK_NSIS_MUI_FINISHPAGE_RUN
2005 Specify an executable to add an option to run on the finish page
2006 of the NSIS installer.
2007
2008 CPACK_NSIS_MENU_LINKS
2009 Specify links in [application] menu. This should contain a list
2010 of pair link link name. The link may be a URL or a path relative
2011 to installation prefix. Like:
2012
2013 set(CPACK_NSIS_MENU_LINKS
2014 "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html"
2015 "CMake Help" "https://cmake.org" "CMake Web Site")
2016
2017 CPACK_NSIS_UNINSTALL_NAME
2018 New in version 3.17.
2019
2020
2021 Specify the name of the program to uninstall the version. De‐
2022 fault is Uninstall.
2023
2024 CPACK_NSIS_WELCOME_TITLE
2025 New in version 3.17.
2026
2027
2028 The title to display on the top of the page for the welcome
2029 page.
2030
2031 CPACK_NSIS_WELCOME_TITLE_3LINES
2032 New in version 3.17.
2033
2034
2035 Display the title in the welcome page on 3 lines instead of 2.
2036
2037 CPACK_NSIS_FINISH_TITLE
2038 New in version 3.17.
2039
2040
2041 The title to display on the top of the page for the finish page.
2042
2043 CPACK_NSIS_FINISH_TITLE_3LINES
2044 New in version 3.17.
2045
2046
2047 Display the title in the finish page on 3 lines instead of 2.
2048
2049 CPACK_NSIS_MUI_HEADERIMAGE
2050 New in version 3.17.
2051
2052
2053 The image to display on the header of installers pages.
2054
2055 CPACK_NSIS_MANIFEST_DPI_AWARE
2056 New in version 3.18.
2057
2058
2059 If set, declares that the installer is DPI-aware.
2060
2061 CPACK_NSIS_BRANDING_TEXT
2062 New in version 3.20.
2063
2064
2065 If set, updates the text at the bottom of the install window.
2066 To set the string to blank, use a space (" ").
2067
2068 CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION
2069 New in version 3.20.
2070
2071
2072 If set, trim down the size of the control to the size of the
2073 branding text string. Allowed values for this variable are
2074 LEFT, CENTER or RIGHT. If not specified, the default behavior
2075 is LEFT.
2076
2077 CPACK_NSIS_EXECUTABLE
2078 New in version 3.21.
2079
2080
2081 If set, specify the name of the NSIS executable. Default is mak‐
2082 ensis.
2083
2084 CPACK_NSIS_IGNORE_LICENSE_PAGE
2085 New in version 3.22.
2086
2087
2088 If set, do not display the page containing the license during
2089 installation.
2090
2091 CPack NuGet Generator
2092 New in version 3.12.
2093
2094
2095 When build a NuGet package there is no direct way to control an output
2096 filename due a lack of the corresponding CLI option of NuGet, so there
2097 is no CPACK_NUGET_PACKAGE_FILE_NAME variable. To form the output file‐
2098 name NuGet uses the package name and the version according to its
2099 built-in rules.
2100
2101 Also, be aware that including a top level directory (CPACK_IN‐
2102 CLUDE_TOPLEVEL_DIRECTORY) is ignored by this generator.
2103
2104 Variables specific to CPack NuGet generator
2105 The CPack NuGet generator may be used to create NuGet packages using
2106 CPack. The CPack NuGet generator is a CPack generator thus it uses the
2107 CPACK_XXX variables used by CPack.
2108
2109 The CPack NuGet generator has specific features which are controlled by
2110 the specifics CPACK_NUGET_XXX variables. In the "one per group" mode
2111 (see CPACK_COMPONENTS_GROUPING), <compName> placeholder in the vari‐
2112 ables below would contain a group name (uppercased and turned into a
2113 "C" identifier).
2114
2115 List of CPack NuGet generator specific variables:
2116
2117 CPACK_NUGET_COMPONENT_INSTALL
2118 Enable component packaging for CPack NuGet generator
2119
2120 • Mandatory : NO
2121
2122 • Default : OFF
2123
2124 CPACK_NUGET_PACKAGE_NAME
2125
2126 CPACK_NUGET_<compName>_PACKAGE_NAME
2127 The NUGET package name. CPACK_NUGET_PACKAGE_NAME is used as the
2128 package id on nuget.org
2129
2130 • Mandatory : YES
2131
2132 • Default : CPACK_PACKAGE_NAME
2133
2134 CPACK_NUGET_PACKAGE_VERSION
2135
2136 CPACK_NUGET_<compName>_PACKAGE_VERSION
2137 The NuGet package version.
2138
2139 • Mandatory : YES
2140
2141 • Default : CPACK_PACKAGE_VERSION
2142
2143 CPACK_NUGET_PACKAGE_DESCRIPTION
2144
2145 CPACK_NUGET_<compName>_PACKAGE_DESCRIPTION
2146 A long description of the package for UI display.
2147
2148 • Mandatory : YES
2149
2150 •
2151
2152 Default :
2153
2154 • CPACK_COMPONENT_<compName>_DESCRIPTION,
2155
2156 • CPACK_COMPONENT_GROUP_<groupName>_DESCRIPTION,
2157
2158 • CPACK_PACKAGE_DESCRIPTION
2159
2160 CPACK_NUGET_PACKAGE_AUTHORS
2161
2162 CPACK_NUGET_<compName>_PACKAGE_AUTHORS
2163 A comma-separated list of packages authors, matching the profile
2164 names on nuget.org. These are displayed in the NuGet Gallery on
2165 nuget.org and are used to cross-reference packages by the same
2166 authors.
2167
2168 • Mandatory : YES
2169
2170 • Default : CPACK_PACKAGE_VENDOR
2171
2172 CPACK_NUGET_PACKAGE_TITLE
2173
2174 CPACK_NUGET_<compName>_PACKAGE_TITLE
2175 A human-friendly title of the package, typically used in UI dis‐
2176 plays as on nuget.org and the Package Manager in Visual Studio.
2177 If not specified, the package ID is used.
2178
2179 • Mandatory : NO
2180
2181 •
2182
2183 Default :
2184
2185 • CPACK_COMPONENT_<compName>_DISPLAY_NAME,
2186
2187 • CPACK_COMPONENT_GROUP_<groupName>_DISPLAY_NAME
2188
2189 CPACK_NUGET_PACKAGE_OWNERS
2190
2191 CPACK_NUGET_<compName>_PACKAGE_OWNERS
2192 A comma-separated list of the package creators using profile
2193 names on nuget.org. This is often the same list as in authors,
2194 and is ignored when uploading the package to nuget.org.
2195
2196 • Mandatory : NO
2197
2198 • Default : -
2199
2200 CPACK_NUGET_PACKAGE_HOMEPAGE_URL
2201
2202 CPACK_NUGET_<compName>_PACKAGE_HOMEPAGE_URL
2203 An URL for the package's home page, often shown in UI displays
2204 as well as nuget.org.
2205
2206 • Mandatory : NO
2207
2208 • Default : CPACK_PACKAGE_HOMEPAGE_URL
2209
2210 CPACK_NUGET_PACKAGE_LICENSEURL
2211
2212 CPACK_NUGET_<compName>_PACKAGE_LICENSEURL
2213 Deprecated since version 3.20: Use a local license file (‐
2214 CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME) or a (SPDX) license iden‐
2215 tifier (CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION) instead.
2216
2217
2218 An URL for the package's license, often shown in UI displays as
2219 well as on nuget.org.
2220
2221 • Mandatory : NO
2222
2223 • Default : -
2224
2225 CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION
2226
2227 CPACK_NUGET_<compName>_PACKAGE_LICENSE_EXPRESSION
2228 New in version 3.20.
2229
2230
2231 A Software Package Data Exchange (SPDX) license identifier such
2232 as MIT, BSD-3-Clause, or LGPL-3.0-or-later. In the case of a
2233 choice of licenses or more complex restrictions, compound li‐
2234 cense expressions may be formed using boolean operators, for ex‐
2235 ample MIT OR BSD-3-Clause. See the SPDX specification for guid‐
2236 ance on forming complex license expressions.
2237
2238 If CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME is specified,
2239 CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION is ignored.
2240
2241 • Mandatory : NO
2242
2243 • Default : -
2244
2245 CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME
2246
2247 CPACK_NUGET_<compName>_PACKAGE_LICENSE_FILE_NAME
2248 The package's license file in .txt or .md format.
2249
2250 If CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME is specified,
2251 CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION is ignored.
2252
2253 New in version 3.20.
2254
2255
2256 • Mandatory : NO
2257
2258 • Default : -
2259
2260 CPACK_NUGET_PACKAGE_ICONURL
2261
2262 CPACK_NUGET_<compName>_PACKAGE_ICONURL
2263 Deprecated since version 3.20: Use a local icon file (‐
2264 CPACK_NUGET_PACKAGE_ICON) instead.
2265
2266
2267 An URL for a 64x64 image with transparency background to use as
2268 the icon for the package in UI display.
2269
2270 • Mandatory : NO
2271
2272 • Default : -
2273
2274 CPACK_NUGET_PACKAGE_ICON
2275
2276 CPACK_NUGET_<compName>_PACKAGE_ICON
2277 New in version 3.20.
2278
2279
2280 The filename of a 64x64 image with transparency background to
2281 use as the icon for the package in UI display.
2282
2283 • Mandatory : NO
2284
2285 • Default : -
2286
2287 CPACK_NUGET_PACKAGE_DESCRIPTION_SUMMARY
2288
2289 CPACK_NUGET_<compName>_PACKAGE_DESCRIPTION_SUMMARY
2290 A short description of the package for UI display. If omitted, a
2291 truncated version of description is used.
2292
2293 • Mandatory : NO
2294
2295 • Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
2296
2297 CPACK_NUGET_PACKAGE_RELEASE_NOTES
2298
2299 CPACK_NUGET_<compName>_PACKAGE_RELEASE_NOTES
2300 A description of the changes made in this release of the pack‐
2301 age, often used in UI like the Updates tab of the Visual Studio
2302 Package Manager in place of the package description.
2303
2304 • Mandatory : NO
2305
2306 • Default : -
2307
2308 CPACK_NUGET_PACKAGE_COPYRIGHT
2309
2310 CPACK_NUGET_<compName>_PACKAGE_COPYRIGHT
2311 Copyright details for the package.
2312
2313 • Mandatory : NO
2314
2315 • Default : -
2316
2317 CPACK_NUGET_PACKAGE_LANGUAGE
2318
2319 CPACK_NUGET_<compName>_PACKAGE_LANGUAGE
2320 New in version 3.20.
2321
2322
2323 Locale specifier for the package, for example en_CA.
2324
2325 • Mandatory : NO
2326
2327 • Default : -
2328
2329 CPACK_NUGET_PACKAGE_TAGS
2330
2331 CPACK_NUGET_<compName>_PACKAGE_TAGS
2332 A space-delimited list of tags and keywords that describe the
2333 package and aid discoverability of packages through search and
2334 filtering.
2335
2336 • Mandatory : NO
2337
2338 • Default : -
2339
2340 CPACK_NUGET_PACKAGE_DEPENDENCIES
2341
2342 CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES
2343 A list of package dependencies.
2344
2345 • Mandatory : NO
2346
2347 • Default : -
2348
2349 CPACK_NUGET_PACKAGE_DEPENDENCIES_<dependency>_VERSION
2350
2351 CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<dependency>_VERSION
2352 A version specification for the particular dependency, where
2353 <dependency> is an item of the dependency list (see above)
2354 transformed with MAKE_C_IDENTIFIER function of string() command.
2355
2356 • Mandatory : NO
2357
2358 • Default : -
2359
2360 CPACK_NUGET_PACKAGE_DEBUG
2361 Enable debug messages while executing CPack NuGet generator.
2362
2363 • Mandatory : NO
2364
2365 • Default : OFF
2366
2367 CPack PackageMaker Generator
2368 PackageMaker CPack generator (macOS).
2369
2370 Deprecated since version 3.17: Xcode no longer distributes the Package‐
2371 Maker tools. This CPack generator will be removed in a future version
2372 of CPack.
2373
2374
2375 Variables specific to CPack PackageMaker generator
2376 The following variable is specific to installers built on Mac macOS us‐
2377 ing PackageMaker:
2378
2379 CPACK_OSX_PACKAGE_VERSION
2380 The version of macOS that the resulting PackageMaker archive
2381 should be compatible with. Different versions of macOS support
2382 different features. For example, CPack can only build compo‐
2383 nent-based installers for macOS 10.4 or newer, and can only
2384 build installers that download components on-the-fly for macOS
2385 10.5 or newer. If left blank, this value will be set to the min‐
2386 imum version of macOS that supports the requested features. Set
2387 this variable to some value (e.g., 10.4) only if you want to
2388 guarantee that your installer will work on that version of
2389 macOS, and don't mind missing extra features available in the
2390 installer shipping with later versions of macOS.
2391
2392 Background Image
2393 New in version 3.17.
2394
2395
2396 This group of variables controls the background image of the generated
2397 installer.
2398
2399 CPACK_PACKAGEMAKER_BACKGROUND
2400 Adds a background to Distribution XML if specified. The value
2401 contains the path to image in Resources directory.
2402
2403 CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT
2404 Adds an alignment attribute to the background in Distribution
2405 XML. Refer to Apple documentation for valid values.
2406
2407 CPACK_PACKAGEMAKER_BACKGROUND_SCALING
2408 Adds a scaling attribute to the background in Distribution XML.
2409 Refer to Apple documentation for valid values.
2410
2411 CPACK_PACKAGEMAKER_BACKGROUND_MIME_TYPE
2412 Adds a mime-type attribute to the background in Distribution
2413 XML. The option contains MIME type of an image.
2414
2415 CPACK_PACKAGEMAKER_BACKGROUND_UTI
2416 Adds an uti attribute to the background in Distribution XML.
2417 The option contains UTI type of an image.
2418
2419 CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA
2420 Adds a background for the Dark Aqua theme to Distribution XML if
2421 specified. The value contains the path to image in Resources di‐
2422 rectory.
2423
2424 CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_ALIGNMENT
2425 Does the same as CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT option,
2426 but for the dark theme.
2427
2428 CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_SCALING
2429 Does the same as CPACK_PACKAGEMAKER_BACKGROUND_SCALING option,
2430 but for the dark theme.
2431
2432 CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_MIME_TYPE
2433 Does the same as CPACK_PACKAGEMAKER_BACKGROUND_MIME_TYPE option,
2434 but for the dark theme.
2435
2436 CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_UTI
2437 Does the same as CPACK_PACKAGEMAKER_BACKGROUND_UTI option, but
2438 for the dark theme.
2439
2440 CPack productbuild Generator
2441 New in version 3.7.
2442
2443
2444 productbuild CPack generator (macOS).
2445
2446 Variables specific to CPack productbuild generator
2447 The following variable is specific to installers built on Mac macOS us‐
2448 ing ProductBuild:
2449
2450 CPACK_COMMAND_PRODUCTBUILD
2451 Path to the productbuild(1) command used to generate a product
2452 archive for the macOS Installer or Mac App Store. This variable
2453 can be used to override the automatically detected command (or
2454 specify its location if the auto-detection fails to find it).
2455
2456 CPACK_PRODUCTBUILD_IDENTITY_NAME
2457 New in version 3.8.
2458
2459
2460 Adds a digital signature to the resulting package.
2461
2462 CPACK_PRODUCTBUILD_KEYCHAIN_PATH
2463 New in version 3.8.
2464
2465
2466 Specify a specific keychain to search for the signing identity.
2467
2468 CPACK_COMMAND_PKGBUILD
2469 Path to the pkgbuild(1) command used to generate an macOS compo‐
2470 nent package on macOS. This variable can be used to override
2471 the automatically detected command (or specify its location if
2472 the auto-detection fails to find it).
2473
2474 CPACK_PKGBUILD_IDENTITY_NAME
2475 New in version 3.8.
2476
2477
2478 Adds a digital signature to the resulting package.
2479
2480 CPACK_PKGBUILD_KEYCHAIN_PATH
2481 New in version 3.8.
2482
2483
2484 Specify a specific keychain to search for the signing identity.
2485
2486 CPACK_PREFLIGHT_<COMP>_SCRIPT
2487 Full path to a file that will be used as the preinstall script
2488 for the named <COMP> component's package, where <COMP> is the
2489 uppercased component name. No preinstall script is added if
2490 this variable is not defined for a given component.
2491
2492 CPACK_POSTFLIGHT_<COMP>_SCRIPT
2493 Full path to a file that will be used as the postinstall script
2494 for the named <COMP> component's package, where <COMP> is the
2495 uppercased component name. No postinstall script is added if
2496 this variable is not defined for a given component.
2497
2498 CPACK_PRODUCTBUILD_RESOURCES_DIR
2499 New in version 3.9.
2500
2501
2502 If specified the productbuild generator copies files from this
2503 directory (including subdirectories) to the Resources directory.
2504 This is done before the CPACK_RESOURCE_FILE_WELCOME, CPACK_RE‐
2505 SOURCE_FILE_README, and CPACK_RESOURCE_FILE_LICENSE files are
2506 copied.
2507
2508 Background Image
2509 New in version 3.17.
2510
2511
2512 This group of variables controls the background image of the generated
2513 installer.
2514
2515 CPACK_PRODUCTBUILD_BACKGROUND
2516 Adds a background to Distribution XML if specified. The value
2517 contains the path to image in Resources directory.
2518
2519 CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT
2520 Adds an alignment attribute to the background in Distribution
2521 XML. Refer to Apple documentation for valid values.
2522
2523 CPACK_PRODUCTBUILD_BACKGROUND_SCALING
2524 Adds a scaling attribute to the background in Distribution XML.
2525 Refer to Apple documentation for valid values.
2526
2527 CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE
2528 Adds a mime-type attribute to the background in Distribution
2529 XML. The option contains MIME type of an image.
2530
2531 CPACK_PRODUCTBUILD_BACKGROUND_UTI
2532 Adds an uti attribute to the background in Distribution XML.
2533 The option contains UTI type of an image.
2534
2535 CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA
2536 Adds a background for the Dark Aqua theme to Distribution XML if
2537 specified. The value contains the path to image in Resources di‐
2538 rectory.
2539
2540 CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_ALIGNMENT
2541 Does the same as CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT option,
2542 but for the dark theme.
2543
2544 CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_SCALING
2545 Does the same as CPACK_PRODUCTBUILD_BACKGROUND_SCALING option,
2546 but for the dark theme.
2547
2548 CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_MIME_TYPE
2549 Does the same as CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE option,
2550 but for the dark theme.
2551
2552 CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_UTI
2553 Does the same as CPACK_PRODUCTBUILD_BACKGROUND_UTI option, but
2554 for the dark theme.
2555
2556 CPack RPM Generator
2557 The built in (binary) CPack RPM generator (Unix only)
2558
2559 Variables specific to CPack RPM generator
2560 The CPack RPM generator may be used to create RPM packages using CPack.
2561 The CPack RPM generator is a CPack generator thus it uses the CPACK_XXX
2562 variables used by CPack.
2563
2564 The CPack RPM generator has specific features which are controlled by
2565 the specifics CPACK_RPM_XXX variables.
2566
2567 CPACK_RPM_<COMPONENT>_XXXX variables may be used in order to have com‐
2568 ponent specific values. Note however that <COMPONENT> refers to the
2569 grouping name written in upper case. It may be either a component name
2570 or a component GROUP name. Usually those variables correspond to RPM
2571 spec file entities. One may find information about spec files here
2572 http://www.rpm.org/wiki/Docs
2573
2574 Changed in version 3.6: <COMPONENT> part of variables is preferred to
2575 be in upper case (e.g. if component is named foo then use
2576 CPACK_RPM_FOO_XXXX variable name format) as is with other CPACK_<COMPO‐
2577 NENT>_XXXX variables. For the purposes of back compatibility
2578 (CMake/CPack version 3.5 and lower) support for same cased component
2579 (e.g. fOo would be used as CPACK_RPM_fOo_XXXX) is still supported for
2580 variables defined in older versions of CMake/CPack but is not guaran‐
2581 teed for variables that will be added in the future. For the sake of
2582 back compatibility same cased component variables also override upper
2583 cased versions where both are present.
2584
2585
2586 Here are some CPack RPM generator wiki resources that are here for his‐
2587 toric reasons and are no longer maintained but may still prove useful:
2588
2589 • https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configuration
2590
2591 • https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#rpm-unix-only
2592
2593 List of CPack RPM generator specific variables:
2594
2595 CPACK_RPM_COMPONENT_INSTALL
2596 Enable component packaging for CPack RPM generator
2597
2598 • Mandatory : NO
2599
2600 • Default : OFF
2601
2602 If enabled (ON) multiple packages are generated. By default a
2603 single package containing files of all components is generated.
2604
2605 CPACK_RPM_PACKAGE_SUMMARY
2606
2607 CPACK_RPM_<component>_PACKAGE_SUMMARY
2608 The RPM package summary.
2609
2610 • Mandatory : YES
2611
2612 • Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
2613
2614 New in version 3.2: Per-component CPACK_RPM_<component>_PACK‐
2615 AGE_SUMMARY variables.
2616
2617
2618 CPACK_RPM_PACKAGE_NAME
2619
2620 CPACK_RPM_<component>_PACKAGE_NAME
2621 The RPM package name.
2622
2623 • Mandatory : YES
2624
2625 • Default : CPACK_PACKAGE_NAME
2626
2627 New in version 3.5: Per-component CPACK_RPM_<component>_PACK‐
2628 AGE_NAME variables.
2629
2630
2631 CPACK_RPM_FILE_NAME
2632
2633 CPACK_RPM_<component>_FILE_NAME
2634 New in version 3.6.
2635
2636
2637 Package file name.
2638
2639 • Mandatory : YES
2640
2641 •
2642
2643 Default
2644 <CPACK_PACKAGE_FILE_NAME>[-<component>].rpm with spaces
2645 replaced by '-'
2646
2647 This may be set to RPM-DEFAULT to allow rpmbuild tool to gener‐
2648 ate package file name by itself. Alternatively provided package
2649 file name must end with .rpm suffix.
2650
2651 NOTE:
2652 By using user provided spec file, rpm macro extensions such
2653 as for generating debuginfo packages or by simply using mul‐
2654 tiple components more than one rpm file may be generated, ei‐
2655 ther from a single spec file or from multiple spec files
2656 (each component execution produces its own spec file). In
2657 such cases duplicate file names may occur as a result of this
2658 variable setting or spec file content structure. Duplicate
2659 files get overwritten and it is up to the packager to set the
2660 variables in a manner that will prevent such errors.
2661
2662 CPACK_RPM_MAIN_COMPONENT
2663 New in version 3.8.
2664
2665
2666 Main component that is packaged without component suffix.
2667
2668 • Mandatory : NO
2669
2670 • Default : -
2671
2672 This variable can be set to any component or group name so that
2673 component or group rpm package is generated without component
2674 suffix in filename and package name.
2675
2676 CPACK_RPM_PACKAGE_EPOCH
2677 New in version 3.10.
2678
2679
2680 The RPM package epoch
2681
2682 • Mandatory : No
2683
2684 • Default : -
2685
2686 Optional number that should be incremented when changing ver‐
2687 sioning schemas or fixing mistakes in the version numbers of
2688 older packages.
2689
2690 CPACK_RPM_PACKAGE_VERSION
2691 The RPM package version.
2692
2693 • Mandatory : YES
2694
2695 • Default : CPACK_PACKAGE_VERSION
2696
2697 CPACK_RPM_PACKAGE_ARCHITECTURE
2698
2699 CPACK_RPM_<component>_PACKAGE_ARCHITECTURE
2700 The RPM package architecture.
2701
2702 • Mandatory : YES
2703
2704 • Default : Native architecture output by uname -m
2705
2706 This may be set to noarch if you know you are building a noarch
2707 package.
2708
2709 New in version 3.3: Per-component CPACK_RPM_<component>_PACK‐
2710 AGE_ARCHITECTURE variables.
2711
2712
2713 CPACK_RPM_PACKAGE_RELEASE
2714 The RPM package release.
2715
2716 • Mandatory : YES
2717
2718 • Default : 1
2719
2720 This is the numbering of the RPM package itself, i.e. the ver‐
2721 sion of the packaging and not the version of the content (see
2722 CPACK_RPM_PACKAGE_VERSION). One may change the default value if
2723 the previous packaging was buggy and/or you want to put here a
2724 fancy Linux distro specific numbering.
2725
2726 NOTE:
2727 This is the string that goes into the RPM Release: field. Some dis‐
2728 tros (e.g. Fedora, CentOS) require 1%{?dist} format and not just a
2729 number. %{?dist} part can be added by setting
2730 CPACK_RPM_PACKAGE_RELEASE_DIST.
2731
2732 CPACK_RPM_PACKAGE_RELEASE_DIST
2733 New in version 3.6.
2734
2735
2736 The dist tag that is added RPM Release: field.
2737
2738 • Mandatory : NO
2739
2740 • Default : OFF
2741
2742 This is the reported %{dist} tag from the current distribution
2743 or empty %{dist} if RPM macro is not set. If this variable is
2744 set then RPM Release: field value is set to ${CPACK_RPM_PACK‐
2745 AGE_RELEASE}%{?dist}.
2746
2747 CPACK_RPM_PACKAGE_LICENSE
2748 The RPM package license policy.
2749
2750 • Mandatory : YES
2751
2752 • Default : "unknown"
2753
2754 CPACK_RPM_PACKAGE_GROUP
2755
2756 CPACK_RPM_<component>_PACKAGE_GROUP
2757 The RPM package group.
2758
2759 • Mandatory : YES
2760
2761 • Default : "unknown"
2762
2763 New in version 3.5: Per-component CPACK_RPM_<component>_PACK‐
2764 AGE_GROUP variables.
2765
2766
2767 CPACK_RPM_PACKAGE_VENDOR
2768 The RPM package vendor.
2769
2770 • Mandatory : YES
2771
2772 • Default : CPACK_PACKAGE_VENDOR if set or "unknown"
2773
2774 CPACK_RPM_PACKAGE_URL
2775
2776 CPACK_RPM_<component>_PACKAGE_URL
2777 The projects URL.
2778
2779 • Mandatory : NO
2780
2781 • Default : CMAKE_PROJECT_HOMEPAGE_URL
2782
2783 New in version 3.12: The CMAKE_PROJECT_HOMEPAGE_URL variable.
2784
2785
2786 CPACK_RPM_PACKAGE_DESCRIPTION
2787
2788 CPACK_RPM_<component>_PACKAGE_DESCRIPTION
2789 RPM package description.
2790
2791 • Mandatory : YES
2792
2793 • Default : CPACK_COMPONENT_<compName>_DESCRIPTION (component
2794 based installers only) if set, CPACK_PACKAGE_DESCRIPTION_FILE
2795 if set or "no package description available"
2796
2797 New in version 3.2: Per-component CPACK_RPM_<component>_PACK‐
2798 AGE_DESCRIPTION variables.
2799
2800
2801 CPACK_RPM_COMPRESSION_TYPE
2802 RPM compression type.
2803
2804 • Mandatory : NO
2805
2806 • Default : -
2807
2808 May be used to override RPM compression type to be used to build
2809 the RPM. For example some Linux distribution now default to lzma
2810 or xz compression whereas older cannot use such RPM. Using this
2811 one can enforce compression type to be used.
2812
2813 Possible values are:
2814
2815 • lzma
2816
2817 • xz
2818
2819 • bzip2
2820
2821 • gzip
2822
2823 CPACK_RPM_PACKAGE_AUTOREQ
2824
2825 CPACK_RPM_<component>_PACKAGE_AUTOREQ
2826 RPM spec autoreq field.
2827
2828 • Mandatory : NO
2829
2830 • Default : -
2831
2832 May be used to enable (1, yes) or disable (0, no) automatic
2833 shared libraries dependency detection. Dependencies are added to
2834 requires list.
2835
2836 NOTE:
2837 By default automatic dependency detection is enabled by rpm
2838 generator.
2839
2840 CPACK_RPM_PACKAGE_AUTOPROV
2841
2842 CPACK_RPM_<component>_PACKAGE_AUTOPROV
2843 RPM spec autoprov field.
2844
2845 • Mandatory : NO
2846
2847 • Default : -
2848
2849 May be used to enable (1, yes) or disable (0, no) automatic
2850 listing of shared libraries that are provided by the package.
2851 Shared libraries are added to provides list.
2852
2853 NOTE:
2854 By default automatic provides detection is enabled by rpm
2855 generator.
2856
2857 CPACK_RPM_PACKAGE_AUTOREQPROV
2858
2859 CPACK_RPM_<component>_PACKAGE_AUTOREQPROV
2860 RPM spec autoreqprov field.
2861
2862 • Mandatory : NO
2863
2864 • Default : -
2865
2866 Variable enables/disables autoreq and autoprov at the same time.
2867 See CPACK_RPM_PACKAGE_AUTOREQ and CPACK_RPM_PACKAGE_AUTOPROV for
2868 more details.
2869
2870 NOTE:
2871 By default automatic detection feature is enabled by rpm.
2872
2873 CPACK_RPM_PACKAGE_REQUIRES
2874
2875 CPACK_RPM_<component>_PACKAGE_REQUIRES
2876 RPM spec requires field.
2877
2878 • Mandatory : NO
2879
2880 • Default : -
2881
2882 May be used to set RPM dependencies (requires). Note that you
2883 must enclose the complete requires string between quotes, for
2884 example:
2885
2886 set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
2887
2888 The required package list of an RPM file could be printed with:
2889
2890 rpm -qp --requires file.rpm
2891
2892 CPACK_RPM_PACKAGE_CONFLICTS
2893
2894 CPACK_RPM_<component>_PACKAGE_CONFLICTS
2895 RPM spec conflicts field.
2896
2897 • Mandatory : NO
2898
2899 • Default : -
2900
2901 May be used to set negative RPM dependencies (conflicts). Note
2902 that you must enclose the complete requires string between
2903 quotes, for example:
2904
2905 set(CPACK_RPM_PACKAGE_CONFLICTS "libxml2")
2906
2907 The conflicting package list of an RPM file could be printed
2908 with:
2909
2910 rpm -qp --conflicts file.rpm
2911
2912 CPACK_RPM_PACKAGE_REQUIRES_PRE
2913
2914 CPACK_RPM_<component>_PACKAGE_REQUIRES_PRE
2915 New in version 3.2.
2916
2917
2918 RPM spec requires(pre) field.
2919
2920 • Mandatory : NO
2921
2922 • Default : -
2923
2924 May be used to set RPM preinstall dependencies (requires(pre)).
2925 Note that you must enclose the complete requires string between
2926 quotes, for example:
2927
2928 set(CPACK_RPM_PACKAGE_REQUIRES_PRE "shadow-utils, initscripts")
2929
2930 CPACK_RPM_PACKAGE_REQUIRES_POST
2931
2932 CPACK_RPM_<component>_PACKAGE_REQUIRES_POST
2933 New in version 3.2.
2934
2935
2936 RPM spec requires(post) field.
2937
2938 • Mandatory : NO
2939
2940 • Default : -
2941
2942 May be used to set RPM postinstall dependencies (re‐
2943 quires(post)). Note that you must enclose the complete requires
2944 string between quotes, for example:
2945
2946 set(CPACK_RPM_PACKAGE_REQUIRES_POST "shadow-utils, initscripts")
2947
2948 CPACK_RPM_PACKAGE_REQUIRES_POSTUN
2949
2950 CPACK_RPM_<component>_PACKAGE_REQUIRES_POSTUN
2951 New in version 3.2.
2952
2953
2954 RPM spec requires(postun) field.
2955
2956 • Mandatory : NO
2957
2958 • Default : -
2959
2960 May be used to set RPM postuninstall dependencies (requires(pos‐
2961 tun)). Note that you must enclose the complete requires string
2962 between quotes, for example:
2963
2964 set(CPACK_RPM_PACKAGE_REQUIRES_POSTUN "shadow-utils, initscripts")
2965
2966 CPACK_RPM_PACKAGE_REQUIRES_PREUN
2967
2968 CPACK_RPM_<component>_PACKAGE_REQUIRES_PREUN
2969 New in version 3.2.
2970
2971
2972 RPM spec requires(preun) field.
2973
2974 • Mandatory : NO
2975
2976 • Default : -
2977
2978 May be used to set RPM preuninstall dependencies (re‐
2979 quires(preun)). Note that you must enclose the complete requires
2980 string between quotes, for example:
2981
2982 set(CPACK_RPM_PACKAGE_REQUIRES_PREUN "shadow-utils, initscripts")
2983
2984 CPACK_RPM_PACKAGE_SUGGESTS
2985
2986 CPACK_RPM_<component>_PACKAGE_SUGGESTS
2987 RPM spec suggest field.
2988
2989 • Mandatory : NO
2990
2991 • Default : -
2992
2993 May be used to set weak RPM dependencies (suggests). If rpmbuild
2994 doesn't support the Suggests tag, CPack will emit a warning and
2995 ignore this variable. Note that you must enclose the complete
2996 requires string between quotes.
2997
2998 CPACK_RPM_PACKAGE_PROVIDES
2999
3000 CPACK_RPM_<component>_PACKAGE_PROVIDES
3001 RPM spec provides field.
3002
3003 • Mandatory : NO
3004
3005 • Default : -
3006
3007 May be used to set RPM dependencies (provides). The provided
3008 package list of an RPM file could be printed with:
3009
3010 rpm -qp --provides file.rpm
3011
3012 CPACK_RPM_PACKAGE_OBSOLETES
3013
3014 CPACK_RPM_<component>_PACKAGE_OBSOLETES
3015 RPM spec obsoletes field.
3016
3017 • Mandatory : NO
3018
3019 • Default : -
3020
3021 May be used to set RPM packages that are obsoleted by this one.
3022
3023 CPACK_RPM_PACKAGE_RELOCATABLE
3024 build a relocatable RPM.
3025
3026 • Mandatory : NO
3027
3028 • Default : CPACK_PACKAGE_RELOCATABLE
3029
3030 If this variable is set to TRUE or ON, the CPack RPM generator
3031 will try to build a relocatable RPM package. A relocatable RPM
3032 may be installed using:
3033
3034 rpm --prefix or --relocate
3035
3036 in order to install it at an alternate place see rpm(8). Note
3037 that currently this may fail if CPACK_SET_DESTDIR is set to ON.
3038 If CPACK_SET_DESTDIR is set then you will get a warning message
3039 but if there is file installed with absolute path you'll get un‐
3040 expected behavior.
3041
3042 CPACK_RPM_SPEC_INSTALL_POST
3043 Deprecated - use CPACK_RPM_SPEC_MORE_DEFINE instead.
3044
3045 • Mandatory : NO
3046
3047 • Default : -
3048
3049 • Deprecated: YES
3050
3051 May be used to override the __spec_install_post section within
3052 the generated spec file. This affects the install step during
3053 package creation, not during package installation. For adding
3054 operations to be performed during package installation, use
3055 CPACK_RPM_POST_INSTALL_SCRIPT_FILE instead.
3056
3057 CPACK_RPM_SPEC_MORE_DEFINE
3058 RPM extended spec definitions lines.
3059
3060 • Mandatory : NO
3061
3062 • Default : -
3063
3064 May be used to add any %define lines to the generated spec file.
3065 An example of its use is to prevent stripping of executables
3066 (but note that this may also disable other default post install
3067 processing):
3068
3069 set(CPACK_RPM_SPEC_MORE_DEFINE "%define __spec_install_post /bin/true")
3070
3071 CPACK_RPM_PACKAGE_DEBUG
3072 Toggle CPack RPM generator debug output.
3073
3074 • Mandatory : NO
3075
3076 • Default : -
3077
3078 May be set when invoking cpack in order to trace debug informa‐
3079 tion during CPack RPM run. For example you may launch CPack like
3080 this:
3081
3082 cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
3083
3084 CPACK_RPM_USER_BINARY_SPECFILE
3085
3086 CPACK_RPM_<componentName>_USER_BINARY_SPECFILE
3087 A user provided spec file.
3088
3089 • Mandatory : NO
3090
3091 • Default : -
3092
3093 May be set by the user in order to specify a USER binary spec
3094 file to be used by the CPack RPM generator instead of generating
3095 the file. The specified file will be processed by config‐
3096 ure_file( @ONLY).
3097
3098 CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
3099 Spec file template.
3100
3101 • Mandatory : NO
3102
3103 • Default : -
3104
3105 If set CPack will generate a template for USER specified binary
3106 spec file and stop with an error. For example launch CPack like
3107 this:
3108
3109 cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
3110
3111 The user may then use this file in order to hand-craft is own
3112 binary spec file which may be used with
3113 CPACK_RPM_USER_BINARY_SPECFILE.
3114
3115 CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
3116
3117 CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
3118
3119 CPACK_RPM_PRE_TRANS_SCRIPT_FILE
3120 Path to file containing pre install/uninstall/transaction
3121 script.
3122
3123 • Mandatory : NO
3124
3125 • Default : -
3126
3127 May be used to embed a pre installation/uninstallation/transac‐
3128 tion script in the spec file. The referred script file (or
3129 both) will be read and directly put after the %pre or %preun
3130 section If CPACK_RPM_COMPONENT_INSTALL is set to ON the in‐
3131 stall/uninstall/transaction script for each component can be
3132 overridden with CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE,
3133 CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE, and
3134 CPACK_RPM_<COMPONENT>_PRE_TRANS_SCRIPT_FILE One may verify which
3135 scriptlet has been included with:
3136
3137 rpm -qp --scripts package.rpm
3138
3139 New in version 3.18: The CPACK_RPM_PRE_TRANS_SCRIPT_FILE vari‐
3140 able.
3141
3142
3143 CPACK_RPM_POST_INSTALL_SCRIPT_FILE
3144
3145 CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
3146
3147 CPACK_RPM_POST_TRANS_SCRIPT_FILE
3148 Path to file containing post install/uninstall/transaction
3149 script.
3150
3151 • Mandatory : NO
3152
3153 • Default : -
3154
3155 May be used to embed a post installation/uninstallation/transac‐
3156 tion script in the spec file. The referred script file (or
3157 both) will be read and directly put after the %post or %postun
3158 section. If CPACK_RPM_COMPONENT_INSTALL is set to ON the in‐
3159 stall/uninstall/transaction script for each component can be
3160 overridden with CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE,
3161 CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE, and
3162 CPACK_RPM_<COMPONENT>_POST_TRANS_SCRIPT_FILE One may verify
3163 which scriptlet has been included with:
3164
3165 rpm -qp --scripts package.rpm
3166
3167 New in version 3.18: The CPACK_RPM_POST_TRANS_SCRIPT_FILE vari‐
3168 able.
3169
3170
3171 CPACK_RPM_USER_FILELIST
3172
3173 CPACK_RPM_<COMPONENT>_USER_FILELIST
3174
3175 • Mandatory : NO
3176
3177 • Default : -
3178
3179 May be used to explicitly specify %(<directive>) file line in
3180 the spec file. Like %config(noreplace) or any other directive
3181 that be found in the %files section. Since the CPack RPM genera‐
3182 tor is generating the list of files (and directories) the user
3183 specified files of the CPACK_RPM_<COMPONENT>_USER_FILELIST list
3184 will be removed from the generated list. If referring to direc‐
3185 tories do not add a trailing slash.
3186
3187 New in version 3.8: You can have multiple directives per line,
3188 as in %attr(600,root,root) %config(noreplace).
3189
3190
3191 CPACK_RPM_CHANGELOG_FILE
3192 RPM changelog file.
3193
3194 • Mandatory : NO
3195
3196 • Default : -
3197
3198 May be used to embed a changelog in the spec file. The referred
3199 file will be read and directly put after the %changelog section.
3200
3201 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST
3202 list of path to be excluded.
3203
3204 • Mandatory : NO
3205
3206 •
3207
3208 Default
3209 /etc /etc/init.d /usr /usr/bin /usr/include /usr/lib
3210 /usr/libx32 /usr/lib64 /usr/share /usr/share/aclocal
3211 /usr/share/doc
3212
3213 May be used to exclude path (directories or files) from the
3214 auto-generated list of paths discovered by CPack RPM. The de‐
3215 fault value contains a reasonable set of values if the variable
3216 is not defined by the user. If the variable is defined by the
3217 user then the CPack RPM generator will NOT any of the default
3218 path. If you want to add some path to the default list then you
3219 can use CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION variable.
3220
3221 New in version 3.10: Added /usr/share/aclocal to the default
3222 list of excludes.
3223
3224
3225 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
3226 additional list of path to be excluded.
3227
3228 • Mandatory : NO
3229
3230 • Default : -
3231
3232 May be used to add more exclude path (directories or files) from
3233 the initial default list of excluded paths. See
3234 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST.
3235
3236 CPACK_RPM_RELOCATION_PATHS
3237 New in version 3.2.
3238
3239
3240 Packages relocation paths list.
3241
3242 • Mandatory : NO
3243
3244 • Default : -
3245
3246 May be used to specify more than one relocation path per relo‐
3247 catable RPM. Variable contains a list of relocation paths that
3248 if relative are prefixed by the value of
3249 CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX or by the value of
3250 CPACK_PACKAGING_INSTALL_PREFIX if the component version is not
3251 provided. Variable is not component based as its content can be
3252 used to set a different path prefix for e.g. binary dir and doc‐
3253 umentation dir at the same time. Only prefixes that are re‐
3254 quired by a certain component are added to that component - com‐
3255 ponent must contain at least one file/directory/symbolic link
3256 with CPACK_RPM_RELOCATION_PATHS prefix for a certain relocation
3257 path to be added. Package will not contain any relocation paths
3258 if there are no files/directories/symbolic links on any of the
3259 provided prefix locations. Packages that either do not contain
3260 any relocation paths or contain files/directories/symbolic links
3261 that are outside relocation paths print out an AUTHOR_WARNING
3262 that RPM will be partially relocatable.
3263
3264 CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX
3265 New in version 3.2.
3266
3267
3268 Per component relocation path install prefix.
3269
3270 • Mandatory : NO
3271
3272 • Default : CPACK_PACKAGING_INSTALL_PREFIX
3273
3274 May be used to set per component CPACK_PACKAGING_INSTALL_PREFIX
3275 for relocatable RPM packages.
3276
3277 CPACK_RPM_NO_INSTALL_PREFIX_RELOCATION
3278
3279 CPACK_RPM_NO_<COMPONENT>_INSTALL_PREFIX_RELOCATION
3280 New in version 3.3.
3281
3282
3283 Removal of default install prefix from relocation paths list.
3284
3285 • Mandatory : NO
3286
3287 •
3288
3289 Default
3290 CPACK_PACKAGING_INSTALL_PREFIX or CPACK_RPM_<COMPO‐
3291 NENT>_PACKAGE_PREFIX are treated as one of relocation
3292 paths
3293
3294 May be used to remove CPACK_PACKAGING_INSTALL_PREFIX and
3295 CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX from relocatable RPM prefix
3296 paths.
3297
3298 CPACK_RPM_ADDITIONAL_MAN_DIRS
3299 New in version 3.3.
3300
3301
3302 • Mandatory : NO
3303
3304 • Default : -
3305
3306 May be used to set additional man dirs that could potentially be
3307 compressed by brp-compress RPM macro. Variable content must be a
3308 list of regular expressions that point to directories containing
3309 man files or to man files directly. Note that in order to com‐
3310 press man pages a path must also be present in brp-compress RPM
3311 script and that brp-compress script must be added to RPM config‐
3312 uration by the operating system.
3313
3314 Regular expressions that are added by default were taken from
3315 brp-compress RPM macro:
3316
3317 • /usr/man/man.*
3318
3319 • /usr/man/.*/man.*
3320
3321 • /usr/info.*
3322
3323 • /usr/share/man/man.*
3324
3325 • /usr/share/man/.*/man.*
3326
3327 • /usr/share/info.*
3328
3329 • /usr/kerberos/man.*
3330
3331 • /usr/X11R6/man/man.*
3332
3333 • /usr/lib/perl5/man/man.*
3334
3335 • /usr/share/doc/.*/man/man.*
3336
3337 • /usr/lib/.*/man/man.*
3338
3339 CPACK_RPM_DEFAULT_USER
3340
3341 CPACK_RPM_<compName>_DEFAULT_USER
3342 New in version 3.6.
3343
3344
3345 default user ownership of RPM content
3346
3347 • Mandatory : NO
3348
3349 • Default : root
3350
3351 Value should be user name and not UID. Note that <compName>
3352 must be in upper-case.
3353
3354 CPACK_RPM_DEFAULT_GROUP
3355
3356 CPACK_RPM_<compName>_DEFAULT_GROUP
3357 New in version 3.6.
3358
3359
3360 default group ownership of RPM content
3361
3362 • Mandatory : NO
3363
3364 • Default : root
3365
3366 Value should be group name and not GID. Note that <compName>
3367 must be in upper-case.
3368
3369 CPACK_RPM_DEFAULT_FILE_PERMISSIONS
3370
3371 CPACK_RPM_<compName>_DEFAULT_FILE_PERMISSIONS
3372 New in version 3.6.
3373
3374
3375 default permissions used for packaged files
3376
3377 • Mandatory : NO
3378
3379 • Default : - (system default)
3380
3381 Accepted values are lists with PERMISSIONS. Valid permissions
3382 are:
3383
3384 • OWNER_READ
3385
3386 • OWNER_WRITE
3387
3388 • OWNER_EXECUTE
3389
3390 • GROUP_READ
3391
3392 • GROUP_WRITE
3393
3394 • GROUP_EXECUTE
3395
3396 • WORLD_READ
3397
3398 • WORLD_WRITE
3399
3400 • WORLD_EXECUTE
3401
3402 Note that <compName> must be in upper-case.
3403
3404 CPACK_RPM_DEFAULT_DIR_PERMISSIONS
3405
3406 CPACK_RPM_<compName>_DEFAULT_DIR_PERMISSIONS
3407 New in version 3.6.
3408
3409
3410 default permissions used for packaged directories
3411
3412 • Mandatory : NO
3413
3414 • Default : - (system default)
3415
3416 Accepted values are lists with PERMISSIONS. Valid permissions
3417 are the same as for CPACK_RPM_DEFAULT_FILE_PERMISSIONS. Note
3418 that <compName> must be in upper-case.
3419
3420 CPACK_RPM_INSTALL_WITH_EXEC
3421 New in version 3.11.
3422
3423
3424 force execute permissions on programs and shared libraries
3425
3426 • Mandatory : NO
3427
3428 • Default : - (system default)
3429
3430 Force set owner, group and world execute permissions on programs
3431 and shared libraries. This can be used for creating valid rpm
3432 packages on systems such as Debian where shared libraries do not
3433 have execute permissions set.
3434
3435 NOTE:
3436 Programs and shared libraries without execute permissions are ig‐
3437 nored during separation of debug symbols from the binary for debug‐
3438 info packages.
3439
3440 Packaging of Symbolic Links
3441 New in version 3.3.
3442
3443
3444 The CPack RPM generator supports packaging of symbolic links:
3445
3446 execute_process(COMMAND ${CMAKE_COMMAND}
3447 -E create_symlink <relative_path_location> <symlink_name>)
3448 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/<symlink_name>
3449 DESTINATION <symlink_location> COMPONENT libraries)
3450
3451 Symbolic links will be optimized (paths will be shortened if possible)
3452 before being added to the package or if multiple relocation paths are
3453 detected, a post install symlink relocation script will be generated.
3454
3455 Symbolic links may point to locations that are not packaged by the same
3456 package (either a different component or even not packaged at all) but
3457 those locations will be treated as if they were a part of the package
3458 while determining if symlink should be either created or present in a
3459 post install script - depending on relocation paths.
3460
3461 Changed in version 3.6: Symbolic links that point to locations outside
3462 packaging path produce a warning and are treated as non relocatable
3463 permanent symbolic links. Previous versions of CMake produced an error
3464 in this case.
3465
3466
3467 Currently there are a few limitations though:
3468
3469 • For component based packaging component interdependency is not
3470 checked when processing symbolic links. Symbolic links pointing to
3471 content of a different component are treated the same way as if
3472 pointing to location that will not be packaged.
3473
3474 • Symbolic links pointing to a location through one or more intermedi‐
3475 ate symbolic links will not be handled differently - if the interme‐
3476 diate symbolic link(s) is also on a relocatable path, relocating it
3477 during package installation may cause initial symbolic link to point
3478 to an invalid location.
3479
3480 Packaging of debug information
3481 New in version 3.7.
3482
3483
3484 Debuginfo packages contain debug symbols and sources for debugging
3485 packaged binaries.
3486
3487 Debuginfo RPM packaging has its own set of variables:
3488
3489 CPACK_RPM_DEBUGINFO_PACKAGE
3490
3491 CPACK_RPM_<component>_DEBUGINFO_PACKAGE
3492 Enable generation of debuginfo RPM package(s).
3493
3494 • Mandatory : NO
3495
3496 • Default : OFF
3497
3498 NOTE:
3499 Binaries must contain debug symbols before packaging so use either
3500 Debug or RelWithDebInfo for CMAKE_BUILD_TYPE variable value.
3501
3502 Additionally, if CPACK_STRIP_FILES is set, the files will be
3503 stripped before they get to the RPM generator, so will not contain
3504 debug symbols and a debuginfo package will not get built. Do not use
3505 with CPACK_STRIP_FILES.
3506
3507 NOTE:
3508 Packages generated from packages without binary files, with binary
3509 files but without execute permissions or without debug symbols will
3510 cause packaging termination.
3511
3512 CPACK_BUILD_SOURCE_DIRS
3513 Provides locations of root directories of source files from
3514 which binaries were built.
3515
3516 • Mandatory : YES if CPACK_RPM_DEBUGINFO_PACKAGE is set
3517
3518 • Default : -
3519
3520 NOTE:
3521 For CMake project CPACK_BUILD_SOURCE_DIRS is set by default to point
3522 to CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR paths.
3523
3524 NOTE:
3525 Sources with path prefixes that do not fall under any location pro‐
3526 vided with CPACK_BUILD_SOURCE_DIRS will not be present in debuginfo
3527 package.
3528
3529 CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX
3530
3531 CPACK_RPM_<component>_BUILD_SOURCE_DIRS_PREFIX
3532 Prefix of location where sources will be placed during package
3533 installation.
3534
3535 • Mandatory : YES if CPACK_RPM_DEBUGINFO_PACKAGE is set
3536
3537 •
3538
3539 Default
3540 "/usr/src/debug/<CPACK_PACKAGE_FILE_NAME>" and for com‐
3541 ponent packaging "/usr/src/debug/<CPACK_PACK‐
3542 AGE_FILE_NAME>-<component>"
3543
3544 NOTE:
3545 Each source path prefix is additionally suffixed by src_<index>
3546 where index is index of the path used from CPACK_BUILD_SOURCE_DIRS
3547 variable. This produces <CPACK_RPM_BUILD_SOURCE_DIRS_PRE‐
3548 FIX>/src_<index> replacement path. Limitation is that replaced path
3549 part must be shorter or of equal length than the length of its re‐
3550 placement. If that is not the case either
3551 CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX variable has to be set to a
3552 shorter path or source directories must be placed on a longer path.
3553
3554 CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS
3555 Directories containing sources that should be excluded from de‐
3556 buginfo packages.
3557
3558 • Mandatory : NO
3559
3560 • Default : "/usr /usr/src /usr/src/debug"
3561
3562 Listed paths are owned by other RPM packages and should there‐
3563 fore not be deleted on debuginfo package uninstallation.
3564
3565 CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS_ADDITION
3566 Paths that should be appended to
3567 CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS for exclusion.
3568
3569 • Mandatory : NO
3570
3571 • Default : -
3572
3573 CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE
3574 New in version 3.8.
3575
3576
3577 Create a single debuginfo package even if components packaging
3578 is set.
3579
3580 • Mandatory : NO
3581
3582 • Default : OFF
3583
3584 When this variable is enabled it produces a single debuginfo
3585 package even if component packaging is enabled.
3586
3587 When using this feature in combination with components packaging
3588 and there is more than one component this variable requires
3589 CPACK_RPM_MAIN_COMPONENT to be set.
3590
3591 NOTE:
3592 If none of the CPACK_RPM_<component>_DEBUGINFO_PACKAGE variables is
3593 set then CPACK_RPM_DEBUGINFO_PACKAGE is automatically set to ON when
3594 CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE is set.
3595
3596 CPACK_RPM_DEBUGINFO_FILE_NAME
3597
3598 CPACK_RPM_<component>_DEBUGINFO_FILE_NAME
3599 New in version 3.9.
3600
3601
3602 Debuginfo package file name.
3603
3604 • Mandatory : NO
3605
3606 • Default : rpmbuild tool generated package file name
3607
3608 Alternatively provided debuginfo package file name must end with
3609 .rpm suffix and should differ from file names of other generated
3610 packages.
3611
3612 Variable may contain @cpack_component@ placeholder which will be
3613 replaced by component name if component packaging is enabled
3614 otherwise it deletes the placeholder.
3615
3616 Setting the variable to RPM-DEFAULT may be used to explicitly
3617 set filename generation to default.
3618
3619 NOTE:
3620 CPACK_RPM_FILE_NAME also supports rpmbuild tool generated package
3621 file name - disabled by default but can be enabled by setting the
3622 variable to RPM-DEFAULT.
3623
3624 Packaging of sources (SRPM)
3625 New in version 3.7.
3626
3627
3628 SRPM packaging is enabled by setting CPACK_RPM_PACKAGE_SOURCES variable
3629 while usually using CPACK_INSTALLED_DIRECTORIES variable to provide di‐
3630 rectory containing CMakeLists.txt and source files.
3631
3632 For CMake projects SRPM package would be produced by executing:
3633
3634 cpack -G RPM --config ./CPackSourceConfig.cmake
3635
3636 NOTE:
3637 Produced SRPM package is expected to be built with cmake(1) exe‐
3638 cutable and packaged with cpack(1) executable so CMakeLists.txt has
3639 to be located in root source directory and must be able to generate
3640 binary rpm packages by executing cpack -G command. The two executa‐
3641 bles as well as rpmbuild must also be present when generating binary
3642 rpm packages from the produced SRPM package.
3643
3644 Once the SRPM package is generated it can be used to generate binary
3645 packages by creating a directory structure for rpm generation and exe‐
3646 cuting rpmbuild tool:
3647
3648 mkdir -p build_dir/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
3649 rpmbuild --define "_topdir <path_to_build_dir>" --rebuild <SRPM_file_name>
3650
3651 Generated packages will be located in build_dir/RPMS directory or its
3652 sub directories.
3653
3654 NOTE:
3655 SRPM package internally uses CPack/RPM generator to generate binary
3656 packages so CMakeScripts.txt can decide during the SRPM to binary
3657 rpm generation step what content the package(s) should have as well
3658 as how they should be packaged (monolithic or components). CMake can
3659 decide this for e.g. by reading environment variables set by the
3660 package manager before starting the process of generating binary rpm
3661 packages. This way a single SRPM package can be used to produce dif‐
3662 ferent binary rpm packages on different platforms depending on the
3663 platform's packaging rules.
3664
3665 Source RPM packaging has its own set of variables:
3666
3667 CPACK_RPM_PACKAGE_SOURCES
3668 Should the content be packaged as a source rpm (default is bi‐
3669 nary rpm).
3670
3671 • Mandatory : NO
3672
3673 • Default : OFF
3674
3675 NOTE:
3676 For cmake projects CPACK_RPM_PACKAGE_SOURCES variable is set to OFF
3677 in CPackConfig.cmake and ON in CPackSourceConfig.cmake generated
3678 files.
3679
3680 CPACK_RPM_SOURCE_PKG_BUILD_PARAMS
3681 Additional command-line parameters provided to cmake(1) exe‐
3682 cutable.
3683
3684 • Mandatory : NO
3685
3686 • Default : -
3687
3688 CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX
3689 Packaging install prefix that would be provided in CPACK_PACKAG‐
3690 ING_INSTALL_PREFIX variable for producing binary RPM packages.
3691
3692 • Mandatory : YES
3693
3694 • Default : "/"
3695
3696 CPACK_RPM_BUILDREQUIRES
3697 List of source rpm build dependencies.
3698
3699 • Mandatory : NO
3700
3701 • Default : -
3702
3703 May be used to set source RPM build dependencies (Buil‐
3704 dRequires). Note that you must enclose the complete build re‐
3705 quirements string between quotes, for example:
3706
3707 set(CPACK_RPM_BUILDREQUIRES "python >= 2.5.0, cmake >= 2.8")
3708
3709 CPACK_RPM_REQUIRES_EXCLUDE_FROM
3710 New in version 3.22.
3711
3712
3713 • Mandatory : NO
3714
3715 • Default : -
3716
3717 May be used to keep the dependency generator from scanning spe‐
3718 cific files or directories for dependencies. Note that you can
3719 use a regular expression that matches all of the directories or
3720 files, for example:
3721
3722 set(CPACK_RPM_REQUIRES_EXCLUDE_FROM "bin/libqsqloci.*\\.so.*")
3723
3724 CPack WIX Generator
3725 CPack WIX generator specific options
3726
3727 New in version 3.7: Support CPACK_COMPONENT_<compName>_DISABLED vari‐
3728 able.
3729
3730
3731 Variables specific to CPack WIX generator
3732 The following variables are specific to the installers built on Windows
3733 using WiX.
3734
3735 CPACK_WIX_UPGRADE_GUID
3736 Upgrade GUID (Product/@UpgradeCode)
3737
3738 Will be automatically generated unless explicitly provided.
3739
3740 It should be explicitly set to a constant generated globally
3741 unique identifier (GUID) to allow your installers to replace ex‐
3742 isting installations that use the same GUID.
3743
3744 You may for example explicitly set this variable in your CMake‐
3745 Lists.txt to the value that has been generated per default. You
3746 should not use GUIDs that you did not generate yourself or which
3747 may belong to other projects.
3748
3749 A GUID shall have the following fixed length syntax:
3750
3751 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
3752
3753 (each X represents an uppercase hexadecimal digit)
3754
3755 CPACK_WIX_PRODUCT_GUID
3756 Product GUID (Product/@Id)
3757
3758 Will be automatically generated unless explicitly provided.
3759
3760 If explicitly provided this will set the Product Id of your in‐
3761 staller.
3762
3763 The installer will abort if it detects a pre-existing installa‐
3764 tion that uses the same GUID.
3765
3766 The GUID shall use the syntax described for CPACK_WIX_UP‐
3767 GRADE_GUID.
3768
3769 CPACK_WIX_LICENSE_RTF
3770 RTF License File
3771
3772 If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used
3773 as-is.
3774
3775 If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is im‐
3776 plicitly converted to RTF by the WIX Generator. The expected
3777 encoding of the .txt file is UTF-8.
3778
3779 With CPACK_WIX_LICENSE_RTF you can override the license file
3780 used by the WIX Generator in case CPACK_RESOURCE_FILE_LICENSE is
3781 in an unsupported format or the .txt -> .rtf conversion does not
3782 work as expected.
3783
3784 CPACK_WIX_PRODUCT_ICON
3785 The Icon shown next to the program name in Add/Remove programs.
3786
3787 If set, this icon is used in place of the default icon.
3788
3789 CPACK_WIX_UI_REF
3790 This variable allows you to override the Id of the <UIRef> ele‐
3791 ment in the WiX template.
3792
3793 The default is WixUI_InstallDir in case no CPack components have
3794 been defined and WixUI_FeatureTree otherwise.
3795
3796 CPACK_WIX_UI_BANNER
3797 The bitmap will appear at the top of all installer pages other
3798 than the welcome and completion dialogs.
3799
3800 If set, this image will replace the default banner image.
3801
3802 This image must be 493 by 58 pixels.
3803
3804 CPACK_WIX_UI_DIALOG
3805 Background bitmap used on the welcome and completion dialogs.
3806
3807 If this variable is set, the installer will replace the default
3808 dialog image.
3809
3810 This image must be 493 by 312 pixels.
3811
3812 CPACK_WIX_PROGRAM_MENU_FOLDER
3813 Start menu folder name for launcher.
3814
3815 If this variable is not set, it will be initialized with
3816 CPACK_PACKAGE_NAME
3817
3818 New in version 3.16: If this variable is set to ., then applica‐
3819 tion shortcuts will be created directly in the start menu and
3820 the uninstaller shortcut will be omitted.
3821
3822
3823 CPACK_WIX_CULTURES
3824 Language(s) of the installer
3825
3826 Languages are compiled into the WixUI extension library. To use
3827 them, simply provide the name of the culture. If you specify
3828 more than one culture identifier in a comma or semicolon delim‐
3829 ited list, the first one that is found will be used. You can
3830 find a list of supported languages at:
3831 http://wix.sourceforge.net/manual-wix3/WixUI_localization.htm
3832
3833 CPACK_WIX_TEMPLATE
3834 Template file for WiX generation
3835
3836 If this variable is set, the specified template will be used to
3837 generate the WiX wxs file. This should be used if further cus‐
3838 tomization of the output is required.
3839
3840 If this variable is not set, the default MSI template included
3841 with CMake will be used.
3842
3843 CPACK_WIX_PATCH_FILE
3844 Optional list of XML files with fragments to be inserted into
3845 generated WiX sources.
3846
3847 New in version 3.5: Support listing multiple patch files.
3848
3849
3850 This optional variable can be used to specify an XML file that
3851 the WIX generator will use to inject fragments into its gener‐
3852 ated source files.
3853
3854 Patch files understood by the CPack WIX generator roughly follow
3855 this RELAX NG compact schema:
3856
3857 start = CPackWiXPatch
3858
3859 CPackWiXPatch = element CPackWiXPatch { CPackWiXFragment* }
3860
3861 CPackWiXFragment = element CPackWiXFragment
3862 {
3863 attribute Id { string },
3864 fragmentContent*
3865 }
3866
3867 fragmentContent = element * - CPackWiXFragment
3868 {
3869 (attribute * { text } | text | fragmentContent)*
3870 }
3871
3872 Currently fragments can be injected into most Component, File,
3873 Directory and Feature elements.
3874
3875 New in version 3.3: The following additional special Ids can be
3876 used:
3877
3878 • #PRODUCT for the <Product> element.
3879
3880 • #PRODUCTFEATURE for the root <Feature> element.
3881
3882
3883 New in version 3.7: Support patching arbitrary <Feature> ele‐
3884 ments.
3885
3886
3887 New in version 3.9: Allow setting additional attributes.
3888
3889
3890 The following example illustrates how this works.
3891
3892 Given that the WIX generator creates the following XML element:
3893
3894 <Component Id="CM_CP_applications.bin.my_libapp.exe" Guid="*"/>
3895
3896 The following XML patch file may be used to inject an Environ‐
3897 ment element into it:
3898
3899 <CPackWiXPatch>
3900 <CPackWiXFragment Id="CM_CP_applications.bin.my_libapp.exe">
3901 <Environment Id="MyEnvironment" Action="set"
3902 Name="MyVariableName" Value="MyVariableValue"/>
3903 </CPackWiXFragment>
3904 </CPackWiXPatch>
3905
3906 CPACK_WIX_EXTRA_SOURCES
3907 Extra WiX source files
3908
3909 This variable provides an optional list of extra WiX source
3910 files (.wxs) that should be compiled and linked. The full path
3911 to source files is required.
3912
3913 CPACK_WIX_EXTRA_OBJECTS
3914 Extra WiX object files or libraries
3915
3916 This variable provides an optional list of extra WiX object
3917 (.wixobj) and/or WiX library (.wixlib) files. The full path to
3918 objects and libraries is required.
3919
3920 CPACK_WIX_EXTENSIONS
3921 This variable provides a list of additional extensions for the
3922 WiX tools light and candle.
3923
3924 CPACK_WIX_<TOOL>_EXTENSIONS
3925 This is the tool specific version of CPACK_WIX_EXTENSIONS.
3926 <TOOL> can be either LIGHT or CANDLE.
3927
3928 CPACK_WIX_<TOOL>_EXTRA_FLAGS
3929 This list variable allows you to pass additional flags to the
3930 WiX tool <TOOL>.
3931
3932 Use it at your own risk. Future versions of CPack may generate
3933 flags which may be in conflict with your own flags.
3934
3935 <TOOL> can be either LIGHT or CANDLE.
3936
3937 CPACK_WIX_CMAKE_PACKAGE_REGISTRY
3938 If this variable is set the generated installer will create an
3939 entry in the windows registry key HKEY_LOCAL_MACHINE\Soft‐
3940 ware\Kitware\CMake\Packages\<PackageName> The value for <Packa‐
3941 geName> is provided by this variable.
3942
3943 Assuming you also install a CMake configuration file this will
3944 allow other CMake projects to find your package with the
3945 find_package() command.
3946
3947 CPACK_WIX_PROPERTY_<PROPERTY>
3948 New in version 3.1.
3949
3950
3951 This variable can be used to provide a value for the Windows In‐
3952 staller property <PROPERTY>
3953
3954 The following list contains some example properties that can be
3955 used to customize information under "Programs and Features"
3956 (also known as "Add or Remove Programs")
3957
3958 • ARPCOMMENTS - Comments
3959
3960 • ARPHELPLINK - Help and support information URL
3961
3962 • ARPURLINFOABOUT - General information URL
3963
3964 • ARPURLUPDATEINFO - Update information URL
3965
3966 • ARPHELPTELEPHONE - Help and support telephone number
3967
3968 • ARPSIZE - Size (in kilobytes) of the application
3969
3970 CPACK_WIX_ROOT_FEATURE_TITLE
3971 New in version 3.7.
3972
3973
3974 Sets the name of the root install feature in the WIX installer.
3975 Same as CPACK_COMPONENT_<compName>_DISPLAY_NAME for components.
3976
3977 CPACK_WIX_ROOT_FEATURE_DESCRIPTION
3978 New in version 3.7.
3979
3980
3981 Sets the description of the root install feature in the WIX in‐
3982 staller. Same as CPACK_COMPONENT_<compName>_DESCRIPTION for com‐
3983 ponents.
3984
3985 CPACK_WIX_SKIP_PROGRAM_FOLDER
3986 New in version 3.7.
3987
3988
3989 If this variable is set to true, the default install location of
3990 the generated package will be CPACK_PACKAGE_INSTALL_DIRECTORY
3991 directly. The install location will not be located relatively
3992 below ProgramFiles or ProgramFiles64.
3993
3994 NOTE:
3995 Installers created with this feature do not take differ‐
3996 ences between the system on which the installer is cre‐
3997 ated and the system on which the installer might be used
3998 into account.
3999
4000 It is therefore possible that the installer e.g. might
4001 try to install onto a drive that is unavailable or unin‐
4002 tended or a path that does not follow the localization or
4003 convention of the system on which the installation is
4004 performed.
4005
4006 CPACK_WIX_ROOT_FOLDER_ID
4007 New in version 3.9.
4008
4009
4010 This variable allows specification of a custom root folder ID.
4011 The generator specific <64> token can be used for folder IDs
4012 that come in 32-bit and 64-bit variants. In 32-bit builds the
4013 token will expand empty while in 64-bit builds it will expand to
4014 64.
4015
4016 When unset generated installers will default installing to Pro‐
4017 gramFiles<64>Folder.
4018
4019 CPACK_WIX_ROOT
4020 This variable can optionally be set to the root directory of a
4021 custom WiX Toolset installation.
4022
4023 When unspecified CPack will try to locate a WiX Toolset instal‐
4024 lation via the WIX environment variable instead.
4025
4026 CPACK_WIX_CUSTOM_XMLNS
4027 New in version 3.19.
4028
4029
4030 This variable provides a list of custom namespace declarations
4031 that are necessary for using WiX extensions. Each declaration
4032 should be in the form name=url, where name is the plain name‐
4033 space without the usual xmlns: prefix and url is an unquoted
4034 namespace url. A list of commonly known WiX schemata can be
4035 found here: https://wixtoolset.org/documentation/manual/v3/xsd/
4036
4038 2000-2022 Kitware, Inc. and Contributors
4039
4040
4041
4042
40433.22.2 Jan 25, 2022 CPACK-GENERATORS(7)