Commit Graph

1200 Commits

Author SHA1 Message Date
Daniel Pfeifer
3c7fee0d99 CPack/NSIS: Allow setting CRCCheck
Fixes: #27260
2025-09-24 19:30:27 +02:00
Brad King
064df8a511 Merge topic 'wix-empty-components'
6e3f6e925d CPack/WiX: Allow multiple empty top-level components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11172
2025-09-12 11:28:17 -04:00
Nils Gladitz
6e3f6e925d CPack/WiX: Allow multiple empty top-level components
Avoid generating empty / conflicting directory components for
the installation root which is shared across components and
(except for the degenerate case of an empty installer)
will always be created implicitly.
2025-09-11 15:18:50 +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
Brad King
bf1841534c Merge topic 'cpack-several-checksums'
bc1c295b95 CPack: Add support for multiple checksums per package

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11141
2025-09-08 11:29:34 -04:00
Sergiu Deitsch
bc1c295b95 CPack: Add support for multiple checksums per package
Closes: #27174
2025-09-05 08:42:17 -04:00
Daniel Nicoletti
1a6dbcc9ea CPack: Add AppImage generator
This AppImage generator only relies on appimagetool and patchelf.

Closes: #27104
Co-authored-by: Brad King <brad.king@kitware.com>
2025-09-03 18:50:40 -04:00
Gonzalo Garramuño
ef739edd20 CPack/DragNDrop: Prevent hdiutil "resource is busy" failures
Run `sync` to finish pending filesystem operations before running `hdiutil`.

Fixes: #27136
2025-08-15 10:33:27 -04:00
kiwixz
57eed59f35 CPack/DEB: Use the same compression type for control tar
Uniform compression is the default since dpkg 1.19.0.
2025-07-29 20:32:48 +02:00
Noki
f0f1d6e147 CPack/WiX: Encode long paths with UNC prefix
Closes: #27049
2025-07-09 14:53:42 -04:00
Roberto Benfatto
865f0032eb CPack/DEB: Remove extra newline at the end of .deb control file
It effectively created a control file with two stanzas when package file
data is appended, one of which lacks required parameters, making this
package impossible to use in a package repository.

Fixes: #26975
2025-06-04 11:30:51 -04:00
Brad King
3bc68185b1 Merge topic 'cpack-DragNDrop-leaks'
07d9e9b5fe CPack/DragNDrop: Release CoreFoundation objects after they are used

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10830
2025-05-28 09:15:50 -04:00
AZero13
07d9e9b5fe CPack/DragNDrop: Release CoreFoundation objects after they are used
Otherwise we will be leaking memory.
2025-05-27 11:19:19 -04:00
AZero13
bbc98fb67a CPack/DragNDrop: Avoid crash when locale identifier creation fails
If `CFLocaleCreateCanonicalLanguageIdentifierFromString` fails, stop
gracefully.  Otherwise we crash because `CFStringGetCString` cannot work
with null `CFStrings`.
2025-05-27 11:09:55 -04:00
Brad King
f8cc68d282 Merge topic 'wix-include-build-dir'
900897b510 CPack/WiX: Add the build directory to IncludeSearchPaths for wix.exe
a86eaf98f7 CPack/WiX: Restore condition for passing build directory to candle search path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10816
2025-05-24 07:15:35 -04:00
Julian Greilich
900897b510 CPack/WiX: Add the build directory to IncludeSearchPaths for wix.exe
In commit f2134169f6 (WiX: Add the build directory to IncludeSearchPaths
for candle.exe, 2018-07-06, v3.13.0-rc1~318^2) we implemented this for
WiX v3 with `candle.exe`.  Use the same mechanism for Wix v4 and upwards
for `wix.exe`.
2025-05-23 08:41:13 -04:00
Julian Greilich
a86eaf98f7 CPack/WiX: Restore condition for passing build directory to candle search path
Refactoring in commit 48adc29721 (replace "std::string::find(x) == 0"
with cmHasPrefix(), 2020-03-20, v3.18.0-rc1~488^2~7) accidentally
changed `std::string::rfind(x, 0) != 0` to `!cmHasSuffix()` instead of
`!cmHasPrefix()`.

This is currently not an big issue, but leads to the build directory
being included even when no source file outside the build directory is
used in the project.
2025-05-23 08:40:44 -04:00
Ben Boeckel
557c44b93e cmStrCat: use character literals where possible
Found and replaced using the `cmstrcat-to-char-literal` rule for
`ast-grep`.
2025-05-15 19:12:04 +02:00
Brad King
57b24e8fef StdIo: Init() automatically in Console()
Applications that initialize a `cm::StdIo::Console` immediately no
longer need to `cm::StdIo::Init` first.
2025-05-13 10:35:47 -04:00
Brad King
3e88020aed StdIo: Replace uses of KWSys ConsoleBuf with StdIo::Console
Issue: #26924
2025-05-13 10:35:47 -04:00
Brad King
cef4676d3a StdIo: Factor out helper to initialize stdin, stdout, and stderr
Move logic from commit c85524a94a (Ensure stdin, stdout, and stderr pipes
are always open, 2019-05-02, v3.15.0-rc1~171^2) and commit 96010cc968
(Ensure stdin, stdout, stderr FILE streams are open on Windows, 2024-01-24,
v3.29.0-rc1~65^2) to a dedicated source.  Expose it through an `Init` class
constructor to make it optionally available during static initialization.

Issue: #26924
2025-05-08 13:39:48 -04:00
Vitaly Stakhovsky
e991145430 Source: Avoid duplicate calls 2025-04-29 06:51:28 -04:00
Brad King
cacd17230f Merge topic 'apple-CoreFoundation-headers'
d736dafa22 Merge branch 'backport-3.31-apple-CoreFoundation-headers'
42390e7aa2 Source: Include specific CoreFoundation headers instead of umbrella header
14ffd1cc4e cmXCodeObject: Drop unused CoreFoundation header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10616
2025-04-09 09:08:38 -04:00
Brad King
d736dafa22 Merge branch 'backport-3.31-apple-CoreFoundation-headers' 2025-04-08 11:39:10 -04:00
Sergey Fedorov
42390e7aa2 Source: Include specific CoreFoundation headers instead of umbrella header
Some CoreFoundation headers included by the umbrella header, which we do
not need, use syntax that GCC does not support.  Avoid including them.

GCC-Issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115880
2025-04-08 11:38:24 -04:00
Brad King
8a3860379d Merge topic 'normalize-input-paths'
5805461074 cmSystemTools: Simplify call to FindProgram for our own executable
db0e2574cb cmSystemTools: Restore FindProgram look-up of on-disk case on Windows
5d700abda4 Source: Simplify FindProgram calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10620
2025-04-08 10:45:46 -04:00
Brad King
5d700abda4 Source: Simplify FindProgram calls
Remove defaulted arguments.  Remove unnecessary `.c_str()`.
2025-04-07 19:55:30 -04:00
Craig Scott
d289d720cb Help: Use consistent plural form for CPack configurations 2025-03-28 15:46:12 +11:00
Nikita Nemkin
2d9ae9de96 CPack: Allow source-relative CPACK_PROJECT_CONFIG_FILE
Resolve relative CPACK_PROJECT_CONFIG_FILE explicitly at config
generation time. Otherwise, it will be resolved at runtime
relative to the CPack execution directory (which could be anything).

Additionally, issue a warning if reading PACK_PROJECT_CONFIG_FILE
fails at runtime.

Fixes: #15522
2025-03-12 20:37:01 +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
Kitware Robot
de273b2e11 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 09:56:07 -05:00
Nikita Nemkin
d1f00444d1 CPack/NSIS: Avoid UNIX-style paths in macro variables
NSIS macro variables MUI_*_BITMAP require Windows-style paths.
Don't rely on the user and convert them explicitly.

For good measure, also convert the paths for MUI_PAGE_LICENSE,
MUI_ICON and MUI_UNIICON.

Note that NSIS scripts only require quotes for strings with spaces
and ConvertToWindowsOutputPath() handles this automatically.

Fixes: #9945
2025-02-14 18:47:14 +05:00
Nikita Nemkin
7c825fd15f cpack: Respect CPACK_ARCHIVE_FILE_NAME for non-component packages
The variable CPACK_ARCHIVE_FILE_NAME (added in 9e06e97d30)
only works if per-component packaging is enabled. This isn't obvious
from the documentation.

Make it also work for non-component packages and adjust documentation.

Fixes: #8769
2025-02-04 20:36:10 +05:00
Johnny Jazeix
09d5a4d7f0 CPack: add uncompressed TAR support
Fixes: #26646
2025-01-31 10:11:32 -05:00
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Kitware Robot
b2ba64add9 Revise C++ coding style using clang-format-18
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Fixes: #26123
2025-01-23 11:43:06 -05:00
Alex Turbov
c3777c1536 ci: Extend spellcheck job with 'typos' tool
Unlike the `codespell`, `typos` is capable of finding typos
in combined identifiers (`CamelCase` or `snake_case`).
2025-01-22 08:51:45 -05: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
f3f70c2f90 StringAlgorithms: Refactor cmTokenize() function
- Refactor and optimize the loop to make it shorter and faster
- Make it push elements into an arbitrary (templated) output iterator
- Make it a template on a separator type with the most used defaults
- Add a backward compatible signature to return `std::vector<std::string>`
- Add an alternative function `cmTokenizedView()` to return a vector of string views
2024-11-06 18:42:17 +04:00
Vitaly Stakhovsky
17ee28728b cmCPackGenerator: Add GetOptionIfSet() to avoid duplicate calls 2024-11-04 12:59:15 -05:00
Brad King
5aed3ee49d cmSystemTools: Add GetLogicalWorkingDirectory
Track the current working directory with symbolic links preserved.
2024-11-03 08:26:36 -05:00
Brad King
bd51803761 Merge topic 'misc-refactoring'
788e5c1043 Tests: Add tests for `cmDocumentationFormatter::PrintFormatted()`
8c1a850c19 cmMessenger: Deduplicate `cmSystemTools::Message()` calls
9c118ae9d4 Refactor: `cmCPackGenerator::DisplayVerboseOutput()` unused arg
5fd795f975 MessageType: Add `UNDEFINED` enum item
a6cae9dbc4 cmMessageCommand: Rename+move `CheckingType` → `Message::CheckType`
bb9071e9e7 cmDocumentationFormatter.cxx: Move padding string creation out of loop
f40712fc10 cmTargetLinkLibrariesCommand: Optimize `ostream::operator<<` calls
1ffb746c92 cmGlobalGenerator.cxx: Optimize `ostream::operator<<` calls
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9920
2024-10-24 09:00:32 -04:00
Brad King
063e98eb4b Merge topic 'normalize-input-paths'
ee83165923 cmake: Explicitly normalize input paths as they exist on disk
9d44a77454 find_*: Explicitly normalize found paths as they exist on disk
967d3ea85c cmake-gui: Explicitly normalize input paths as they exist on disk
074ad98ebc ctest: Explicitly normalize input paths as they exist on disk
1f14238701 cpack: Explicitly normalize input paths as they exist on disk
9fe09ebc53 cmSystemTools: Add GetEnvPathNormalized to get paths from environment
2108f3507f cmSystemTools: Add SplitEnvPathNormalized to split paths from environment
6d57403e14 cmSystemTools: Fix SplitEnvPath to avoid empty paths
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9929
2024-10-23 08:30:35 -04:00
Brad King
1f14238701 cpack: Explicitly normalize input paths as they exist on disk 2024-10-22 13:24:46 -04:00
Alex Turbov
9c118ae9d4 Refactor: cmCPackGenerator::DisplayVerboseOutput() unused arg 2024-10-22 01:06:30 +04:00
leha-bot
e7371f5a18 cpack: Allow -D flag to be used without separator
`cmake` and `ctest` already accept `-Dvar=value`.

Fixes: #26394
2024-10-21 16:31:04 -04:00
Daniel Pfeifer
281e9039cb cmWorkingDirectory: Unify error messages 2024-10-18 15:04:07 -04:00
Julien Marrec
3331c7032f CPack/IFW: Add option for ProductImages URLs
Add a `CPACK_IFW_PACKAGE_PRODUCT_IMAGE_URLS` variable for them.
2024-09-11 08:44:09 -04:00
Julien Marrec
d58f90f628 CPack/IFW: Actually ignore missing ProductImages 2024-09-11 08:10:52 -04:00
Julien Marrec
3c214f2638 CPack/IFW: Fix generation of ProductImages
Entries of `CPACK_IFW_PACKAGE_PRODUCT_IMAGES` each need their own
`ProductImage element.

Fixes: #26268
2024-09-10 14:31:47 +02:00