161 Commits
Author SHA1 Message Date
Pedro López-Cabanillas 6b695daab8 CPack/NSIS: Fix PATH modification without "bin" directory
Previously our NSIS project template hard-coded `$INSTDIR\bin` for
inclusion in the `PATH`.  If the directory does not exist, nothing is
done.  Use `CPACK_NSIS_EXECUTABLES_DIRECTORY` instead of `bin`.

Fixes: #15635
2026-08-28 11:18:18 -04:00
Alex Turbov da9a8a3fbe CPack/DEB: Fix regression when package architecture is explicitly specified
Since commit 302a645d73 (CPack/DEB: use `triggers` instead of legacy
postXXX scripts for `ldconfig`, 2026-03-05, v4.4.0-rc1~583^2) the
`triggers` feature refers to `DPKG_EXECUTABLE` if the latter is defined.
Unfortunately, it is defined only if one particular execution branch has
executed.  Move the `find_program(dpkg)` to the function scope to make
it available in all execution branches.
2026-07-30 12:28:11 -04:00
scivision 7406f0be82 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Capture `execute_process` calls' `RESULT_VARIABLE`.

We don't actually need to check the result as we presume the existing
logic is already adequate, and sometimes programs return non-zero values
as result of valid query.  I.e. this is a "safe" way to broadly protect
these scripts.

Issue: #27782
2026-05-07 13:36:36 -04:00
Alex Turbov 30aa150c25 CPack/RPM: CPACK_RPM_SPEC_MORE_DEFINE could be a list
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2026-04-12 05:54:58 +04:00
Alex Turbov 1f939db3c4 CPack/RPM: Remove superfluous %clean section from generated spec file
According to [this] commit message in the `rpmlint` codebase,
a %clean section is not necessary since `rpm` 4.8.0 (2010)
and nowadays `rpmlint` at least issues a warning about it, and
(seems) in some distros it's even considered as an error.

[this]: https://github.com/rpm-software-management/rpmlint/commit/b1a8a422
2026-03-08 03:52:21 +04:00
Alex Turbov 302a645d73 CPack/DEB: use triggers instead of legacy postXXX scripts for ldconfig 2026-03-05 23:14:10 +04:00
Alex Turbov f461382d42 CPack/DEB: rename variable w/ result of dpkg find to match other vars 2026-03-05 22:07:58 +04:00
Alex Turbov 8a8bceda98 CPack/DEB: rename internal variable 2026-03-05 22:06:12 +04:00
Alex Turbov 430eb26511 CPack/DEB: modernize parent scope variables pass 2026-03-04 21:29:45 +04:00
Alex Turbov 165889e7d2 CPack/DEB: refactor some functions to check for errors+exit earlier
… and deindent the rest of the function body.
2026-03-04 21:29:45 +04:00
Alex Turbov ed04dda2a2 CPack/DEB: wrap too long lines 2026-03-04 21:29:45 +04:00
Alex Turbov 6978f9591c CPack/DEB: remove redundant quotes and variable expansions 2026-03-04 21:29:44 +04:00
Alex Turbov 4c889716fa CPack/DEB: modernize filesystem operations 2026-03-04 20:31:50 +04:00
Alex Turbov 963a022782 CPack/RPM: wrap some too long lines 2026-03-03 21:42:47 +04:00
Alex Turbov 17a39084c2 CPack/RPM: some other simplifications 2026-03-03 21:42:47 +04:00
Alex Turbov 0966151c73 CPack/RPM: modernize file and path operations 2026-03-03 21:42:47 +04:00
Alex Turbov 16407d6934 CPack/RPM: escape regex in the modern way 2026-03-03 21:42:46 +04:00
Alex Turbov 9ed6106a27 CPack/RPM: remove redundant quotes and variable expansions 2026-03-03 21:42:38 +04:00
Alex Turbov d7701b758b CPack/RPM: use list transform instead of string manipulations 2026-03-03 21:41:52 +04:00
Alex Turbov fd321c02c5 CPack/RPM: ls -la execution + parse → file(READ_SYMLINK) 2026-03-03 21:41:52 +04:00
Alex Turbov 8549727ff4 CPack/RPM: use the modern return(PROPAGATE…) 2026-03-03 21:41:52 +04:00
Alex Turbov 2fe2665541 CPack/RPM: execute stat to get permissions instead of ls -l
Ask `stat` to output only human-readable permissions and nothing else.
Secondly, simplify parsing algorithm. Instead of multiple regex matches
transform permissions into a list and split into groups.
2026-03-03 21:41:52 +04:00
Alex Turbov 6445447692 CPack/RPM: modernize foreach calls to use IN LISTS/ITEMS 2026-02-28 02:27:38 +04:00
AJIOB 0bca70968a CPack: support archive compression level
Fixes: #18117
2026-01-09 10:35:04 -05:00
Brad King 12be5c60ff Merge topic 'cpack-stgz-deref-symlinks'
ecbe5a8479 CPack/STGZ: Avoid replacing directory symlinks if possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11526
2025-12-18 10:37:58 -05:00
Brad King ecbe5a8479 CPack/STGZ: Avoid replacing directory symlinks if possible
When installing into a prefix with existing directory symlinks, tell
`tar` not to replace them with real directories from the package.

Fixes: #21119
2025-12-17 17:33:23 -05:00
Kevin Barre 07fe3f95ce CPack/DEB: Add CPACK_DEBIAN_COMPRESSION_LEVEL variable
Add a new variable `CPACK_DEBIAN_COMPRESSION_LEVEL` to control the compression
level used when generating Debian packages. This complements the existing
`CPACK_DEBIAN_COMPRESSION_TYPE` variable and allows finer control over the
compression performance vs. size trade-off. Supported values correspond to
the compression level accepted by the underlying compressor (e.g. gzip, xz,
zstd, etc.).
2025-12-17 14:27:10 -05:00
Alex Turbov 8de02a14c8 ci(pre-commit): version bump typos hook plus fix found typos 2025-10-23 21:14:25 +04:00
Daniel Pfeifer 3c7fee0d99 CPack/NSIS: Allow setting CRCCheck
Fixes: #27260
2025-09-24 19:30:27 +02:00
Nils Gladitz 193f17102f CPack/WiX: Implement opt-in per component .cab
By setting CPACK_WIX_CAB_PER_COMPONENT users can generate one
.cab per component instead of one .cab per installer.

WiX compresses .cab files in parallel.
This may potentially speed up installer creation.

May also allow larger installers (there is a 2GB per .cab limit).
2025-09-10 12:24:42 +02:00
Jens Carl e71396c8db CPack/NuGet: Enable the generation of NuGet symbol package(s)
Enable the generation of NuGet symbol package(s) with the new variable
`CPACK_NUGET_SYMBOL_PACKAGE`. CPack generates then normal nuget package
(*.nupkg) and a symbol nuget package (*.snupkg). The new generate
package contains PDB files.

Fixes: #26976
2025-06-05 10:41:22 -04:00
Donald Lee 4244f704b4 CPack/RPM: Fix warn of not relocatable path
The incorrect variable name may fail to warn about not relocatable paths.

Signed-off-by: Donald Lee <donald790411@gmail.com>
2025-05-14 18:52:06 +08:00
Brad King 0af6821799 Merge topic 'cpack-rpm-weak-deps-tags'
14baa13ab8 CPack/RPM: Add support for all weak dependency tags
847f515934 Tests: Simplify RunCMake.CPack_RPM.SUGGESTS expected output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10415
2025-03-04 08:47:25 -05:00
Kitware Robot 1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Balazs KosarasandBrad King 14baa13ab8 CPack/RPM: Add support for all weak dependency tags
Co-authored-by: Brad King <brad.king@kitware.com>
2025-03-03 09:09:15 -05:00
Brad King 759ba45bdb Merge topic 'cpack-rpm-weak-deps'
283a48403f CPack/RPM: Fix detection of RPM support for weak dependencies
ab4e74ad0b CPack/RPM: Remove redundant conditions for presence of rpmbuild

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10403
2025-03-03 08:56:55 -05:00
Brad King 283a48403f CPack/RPM: Fix detection of RPM support for weak dependencies
Add a missing `find_program` call to populate `RPM_EXECUTABLE`.
This was left out of two previous changes that intended to query
the `rpm` executable:

* In commit 9b53eca317 (CPack/RPM: Fix weak dep support, 2021-06-29,
  v3.21.0-rc2~4^2), without `RPM_EXECUTABLE` the query always failed,
  so we were concluding that weak dependencies are not supported even
  when they are.

* In commit 488de6294a (CPack: correctly perform querytags on old
  versions of RPM, 2025-01-09, v4.0.0-rc1~182^2~3), without
  `RPM_EXECUTABLE` the query always failed.  This change has not
  yet been in a release anyway.

Also fix the test case for the "suggests" field to verify this.

Issue: #22350
Reported-by: Balazs Kosaras <balazskosaras@gmail.com>
2025-02-28 17:24:44 -05:00
Brad King ab4e74ad0b CPack/RPM: Remove redundant conditions for presence of rpmbuild
If `rpmbuild` is missing, error out early.

While at it, drop unfinished `alien` support.
2025-02-28 17:06:47 -05:00
Nikita Nemkin 33e85acff7 CPack/NSIS: Use the installed display name in uninstall prompt
When a new installation prompts to uninstall the old version,
use the display name of the old version from the registry.

This only affects packages that change their CPACK_NSIS_DISPLAY_NAME.

Patch-by: David Golub <golubdr@gmail.com>
Fixes: #14112
2025-02-20 13:12:11 +05:00
Brad King c283aafe62 CMP0057: Remove support for OLD behavior 2025-01-22 10:40:53 -05:00
makise-homura 488de6294a CPack: correctly perform querytags on old versions of RPM
In some versions of RPM, e.g. 4.0.4, rpmbuild does not understand
--querytags parameter, but rpm does. Such behavior was found on
Alt Linux P10 and Alt Linux Sisyphus (e2k).
2025-01-17 07:37:22 +03:00
Alex Turbov bc8621d999 Fix: A lot of typos in code found by typos
Yet another great code spellchecker: https://github.com/crate-ci/typos/

(Will be added later as a `pre-commit` hook)
2025-01-12 18:49:34 +04:00
Alex Turbov 78e45c2db6 Style: Replace TABs with spaces for indentation in some files
Mark files that must use TABs to indent in the `.gitattributes`.
Use space instead of TABs in sources and some data/test files.
2025-01-12 18:49:25 +04:00
Brad King 7605228f5e codespell: Fix typos 2024-10-25 08:43:04 -04:00
Edoardo Bortolozzo 443a06807c CPackDeb: always treat PACKAGE_DEPENDS as a list
Remove some edge cases where if CPACK_DEBIAN_PACKAGE_DEPENDS is a list
it would not be expanded on all components leaving some with ';'(s) in
the Depends field of the control file.
Same goes for using CPACK_DEBIAN_PACKAGE_SHLIBDEPS.
2024-10-03 08:52:14 -04:00
Brad King 4aca6d8327 Merge topic 'cpack-nuget-native'
c358872976 CPack/NuGet: Add native0.0 to build dependencies in groups

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9829
2024-09-20 10:05:53 -04:00
Diego Dassie c358872976 CPack/NuGet: Add native0.0 to build dependencies in groups
Add the `native0.0` framework to the list of allowed frameworks allowing
native (C/C++) NuGet packages. This extends commit 0f4d3664a9
(CPack/NuGet: Build dependencies in groups, 2024-06-01, v3.30.0-rc1~18^2).

Fixes: #26305
2024-09-19 08:21:38 +02:00
raspopov e8b9eebd63 CPack/InnoSetup: Template file in UTF-8 BOM to support Unicode 2024-08-15 20:05:21 +03:00
Joel Johnson fab5c030ad CPack/RPM: Add zstd compression support
Fixes: #26088
2024-07-01 12:17:24 -04:00
Joel Johnson a25be17bc4 CPack/RPM: emit error on invalid CPACK_RPM_COMPRESSION_TYPE 2024-07-01 12:16:44 -04:00