Commit Graph

971 Commits

Author SHA1 Message Date
Brad King
ec1b6157cb Update CMake code using KWSys to account for Status return values
KWSys as of 2021-04-14 changed the return type of `SystemTools`
operations from `bool` to `Status`.  Update our call sites.
This may improve error reporting accuracy in a few places.
2021-04-14 13:14:09 -04:00
Brad King
d9b8acd238 Merge topic 'ifw-depends-name-version-parsing'
a43783a08d CPackIFW: Fix parsing of name and version in component DEPENDS
f536e6f3fb CPackIFW: Remove redundant variable assignment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5929
2021-03-30 09:56:31 -04:00
Craig Scott
a43783a08d CPackIFW: Fix parsing of name and version in component DEPENDS
The DEPENDS or DEPENDENCIES arguments in a call to
cpack_ifw_configure_component() or cpack_ifw_configure_component_group()
specify a name and optionally a version constraint as a single string.
QtIFW also allows a colon (requires QtIFW 3.1 or later) or a hyphen to
separate the name and version. The version may optionally contain a
leading operator, with = being assumed when no operator is present.

The previous code was not handling : as a separator at all and was
erroneously dropping the version part when no operator was given.
Fix both of those non-conforming behaviors and also warn if trying
to use a hyphen in a name with a QtIFW version that isn't recent enough
to support it.

Fixes: #21697
2021-03-27 07:44:00 +11:00
Craig Scott
f536e6f3fb CPackIFW: Remove redundant variable assignment
This was showing up in cppcheck results.
2021-03-24 18:23:06 +11:00
Craig Scott
f226a1678f Merge branch 'master' into nsis-branding-trim-position 2021-03-24 16:35:49 +11:00
Craig Scott
a6a5256395 CPack: Validate and document NSIS branding text trim positions 2021-03-24 16:35:29 +11:00
Olivier Iffrig
c456b09513 CPack: Fix symbolic link detection for directories
In the case where the current path is a symlink to a directory, a
trailing slash causes the link to be dereferenced, which means that any
subsequent `FileIsSymlink` on it will return false.

Fixes: #21886
2021-03-05 08:21:13 -05:00
Kevin Ushey
e3ac388738 cpack: add CPACK_DMG_FILESYSTEM
Allow users to configure the filesystem format of the generated `.dmg`
via the `CPACK_DMG_FILESYSTEM` option.

Fixes: #21874
2021-03-02 10:11:15 -05:00
Brad King
ec5f76753a Merge topic 'cpack_nsis_executable_custom'
8e8b99d01a CPack/NSIS: Add option for setting custom makensis executable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5839
2021-02-23 08:11:05 -05:00
Johnny Jazeix
8e8b99d01a CPack/NSIS: Add option for setting custom makensis executable
It allows users to set a custom one without changing the PATH environment variable.

Fixes: #21733
2021-02-22 17:59:04 +01:00
Craig Scott
90c2f138ee CPackIFWInstaller: Avoid potential null pointer dereference
In d16830324f (CPackIFW: Improve warning and docs for show page list
option, 2021-02-14), code was added to report the current QtIFW version.
That code didn't check that there was a Generator object before using it,
resulting in a scanbuild warning about a potential null pointer dereference.
Add a check and output a more general warning message if we don't have
the current QtIFW version available to report.
2021-02-19 17:11:53 +11:00
Craig Scott
d16830324f CPackIFW: Improve warning and docs for show page list option 2021-02-14 15:33:45 +11:00
Craig Scott
7ed7db88a4 CPackIFW: Fix cppcheck warnings
The cppcheck warnings about uninitialised variables are likely harmless,
since they are initialised in ParseResource() anyway. Fix the warnings
anyway to reduce linting noise. The warning about a single argument
non-explicit constructor is worth fixing in general.
2021-02-14 15:24:25 +11:00
Johnny Jazeix
0aabeb0c30 CPack/NSIS: Add option for setting branding text
See https://nsis.sourceforge.io/Reference/BrandingText
for more information.

Fixes: #21479
2021-02-07 16:10:57 +01:00
Brad King
9b96fbc358 Merge topic 'clang-tidy-fixes'
ef935b17ab clang-tidy: fix `readability-use-anyofallof` warnings
9ac8dbbb94 clang-tidy: fix `readability-simplify-boolean-expr` warnings
ca505718f4 clang-tidy: fix `readability-redundant-string-init` warnings
b3b6ede6a1 clang-tidy: fix `readability-redundant-access-specifiers` warnings
cdfc4e3195 clang-tidy: fix `readability-qualified-auto` warnings
808b17b120 clang-tidy: fix `readability-make-member-function-const` warnings
4470eb5179 clang-tidy: fix `performance-trivially-destructible` warnings
4f396e6528 clang-tidy: fix `performance-no-automatic-move` warnings
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5731
2021-01-27 09:52:18 -05:00
Ben Boeckel
808b17b120 clang-tidy: fix readability-make-member-function-const warnings 2021-01-27 08:45:45 -05:00
Rodolfo Lima
bdf30bdad8 CPack: add CPACK_THREADS variable to control compression threads
This allows setting how many threads the compressor will use.
Currently only implemented for XZ when using system's lzma library.

Fixes: #21715
2021-01-26 16:23:37 +01:00
Asit Dhal
8f33674491 cpack(DEB): Issue warning if custom script for control file is missing
Fixes: #17794
2021-01-15 16:41:37 +01:00
Oleksandr Koval
209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Konstantin Podsvirov
8b5a0e0fef CPackIFW: Add CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST variable
Add CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST variable to
control visibility of the widget listing installer pages on the left side
of the wizard. This feature available only since QtIFW 4.0.
2020-11-27 22:32:45 +03:00
Andrew Fuller
c826745f5a CPack/DEB: Do not crash when asked for debug symbols when there are none
Fixes: #21356
2020-11-16 14:03:07 -05:00
Asit Dhal
03ad0e61c1 configure_file: Add option for user defined permissions
User defined permissions and options to copy permissions are
implemented.

Fixes: #20866
2020-10-24 12:00:47 +02:00
Brad King
9493532f80 Merge topic 'cmake-E-cat-binary'
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:51 -04:00
Brad King
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management 2020-10-14 12:08:06 -04:00
Brad King
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx 2020-10-14 12:06:50 -04:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Fritz Elfert
267de3ba30 CPack/WiX: Add support for custom XML namespaces
Add a `CPACK_WIX_CUSTOM_XMLNS` option to specify these.

Fixes: #21098
2020-08-18 07:50:49 -04:00
Vitaly Stakhovsky
f37c14e930 Source: use cmNonempty() 2020-07-28 08:31:31 -04:00
Vitaly Stakhovsky
8ef18e8525 Clean a few string conversions 2020-07-09 09:42:00 -04:00
Brad King
1ace607329 CPack/DragNDrop: Re-implement SLA attachment to avoid deprecated tools
The `Rez` tool has been deprecated since Xcode 6.  The `hdiutil flatten`
and `hdiutil unflatten` tools have been deprecated since macOS 10.15 and
are removed in macOS 11.  Instead use `hdiutil udifrez` to attach the
SLA resources to disk images.  This tool accepts XML input files, so
convert our resource file generation to produce that format.

Fixes: #20889
2020-07-07 08:08:21 -04:00
Brad King
977f5ed3d1 Merge topic 'restore-cwd-translation-map'
85a945a607 Restore handling of build directory inside a symlinked path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4963
2020-07-03 07:25:31 -04:00
Brad King
85a945a607 Restore handling of build directory inside a symlinked path
In commit dd8365b3f1 (Merge branch 'upstream-KWSys' into update-kwsys,
2020-04-06, v3.18.0-rc1~397^2) we imported KWSys commit `019afb6ea`
(SystemTools: Drop GetCurrentWorkingDirectory 'collapse' argument,
2020-04-03).  That caused `GetCurrentWorkingDirectory` to no longer send
paths through the KWSys translation map and broke CMake's detection of
the absolute path to a build directory containing a symbolic link.
Add our own `cmSystemTools::GetCurrentWorkingDirectory` wrapper around
the KWSys method in order to restore that mapping.

Test-case-by: Ben Boeckel <ben.boeckel@kitware.com>
Issue: #16228
Fixes: #20900
2020-07-02 07:33:16 -04:00
Rahul Gottipati
27b03281e2 configure_file: Add option to control file permissions transfer to copy
Issue: #20866
2020-06-30 11:20:41 -04:00
Alex Turbov
915409af49 CPack: Introduce pre- and post- build actions
CPack learned the `CPACK_PRE_BUILD_SCRIPTS`, `CPACK_POST_BUILD_SCRIPTS`,
and `CPACK_PACKAGE_FILES` variables.

The first two are lists of scripts to perform
- after pre-install files into a staging directory and before
  producing the resulting packages
- after produsing the packages

The post-build script(s) also get the list of actually produced
packages in the `CPACK_PACKAGE_FILES`.

Issue: #19077
2020-06-15 11:06:41 -04:00
Alex Turbov
a6e1b20bab CPack External: Introduce CPACK_EXTERNAL_BUILT_PACKAGES
The `CPACK_EXTERNAL_PACKAGE_SCRIPT` script may set this list variable to the
full paths of generated package files. CPack copy these files from the stage
directory back to the top build directory and possibly produce checksum files
if the `CPACK_PACKAGE_CHECKSUM` is set.
2020-06-05 08:56:32 -04:00
Vitaly Stakhovsky
1e805f53f5 GetDefinition: avoid duplicate calls 2020-05-29 13:12:22 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Kyle Edwards
3ffd2741c1 CPack: Fix newline output in .deb generator
When running CPack on Windows, LF newlines are converted to CRLF
unless binary mode is used. Use binary mode whenever possible.

Fixes: #20659
2020-04-30 10:58:22 -04:00
Ben Boeckel
24a9fed5d9 IWYU: mark <cstddef> as needed
Newer IWYU is not seeing them as needed for `size_t`.
2020-04-29 11:16:44 -04:00
Brad King
fb5d24fa3c Merge topic 'cpack-symlinks'
bcc5cd44ed CPack: Do not recurse through directory symlinks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4637
2020-04-22 08:30:53 -04:00
Brad King
bcc5cd44ed CPack: Do not recurse through directory symlinks
Extend the fix from commit 7b8dcdd173 (CPack: Do not recurse through
directory symlinks (#12284), 2011-08-27, v2.8.6~55^2) to more places in
CPack.

Issue: #12284
2020-04-21 07:28:06 -04:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Brad King
4f7d16c68f Merge topic 'cpack-nsis-dpi-aware'
d6840a4f3c CPack/NSIS: Add option for setting DPI-aware

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4607
2020-04-15 09:50:49 -04:00
Johnny Jazeix
d6840a4f3c CPack/NSIS: Add option for setting DPI-aware
See https://nsis.sourceforge.io/Reference/ManifestDPIAware
for more information.

Fixes: #17724
2020-04-14 13:47:49 +02:00
Ben Boeckel
f2a33107be clang-tidy: address bugprone-branch-clone lints
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with
other conditionals between cloned blocks may be relying on the
intermediate logic to fall out of the case and inverting this logic may
be non-trivial.

See: https://bugs.llvm.org/show_bug.cgi?id=44165
2020-04-13 11:26:02 -04:00
Brad King
f0a27e44f3 Merge topic 'parallel-lzma-compression'
b3bacf0152 cmCPackArchiveGenerator: support multithreaded compression
b71d385ed4 cmCPackArchiveGenerator: support setting archive options
948aa8bd1c cmArchiveWrite: support setting archive filter options
b9c17de023 cmArchiveWrite: split out opening the file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !3195
2020-04-06 08:28:19 -04:00
Brad King
56cccde235 cmWorkingDirectory: Add GetOldDirectory method 2020-04-03 09:55:49 -04:00
Brad King
753817e71d CPack/FreeBSD: Use RAII to save/restore working directory 2020-04-03 09:55:49 -04:00
Ben Boeckel
b3bacf0152 cmCPackArchiveGenerator: support multithreaded compression 2020-04-03 07:35:35 -04:00