130 Commits

Author SHA1 Message Date
Brad King
e32b49e4de Merge topic 'cpack-nsis-uninstaller'
8721658959 CPack/NSIS: Fix installer not waiting for uninstaller to finish

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7774
2022-10-11 09:48:37 -04:00
Mika Fischer
8721658959 CPack/NSIS: Fix installer not waiting for uninstaller to finish
In commit b795c96727 (CPack/NSIS: Fix uninstall command when run from
installer, 2022-03-21, v3.23.0-rc5~9^2~1) we incorrectly removed the
`_?` parameter when calling the uninstaller during installation.
This parameter is however essential for ExecWait to actually wait for
the uninstaller to finish.  Without it, the uninstaller is started in
the background and installer and uninstaller run at the same time.

See https://nsis.sourceforge.io/Docs/Chapter3.html#installerusageuninstaller

Add back the `_?` parameter to fix this regression.  Use another
approach to solve the problem motivating the original change.

Fixes: #24041
2022-10-10 10:41:45 -04:00
Matthew Woehlke
db76876db5 Modules: Use new SOURCES_FROM_* try_compile (1/2)
Modify some modules that ship with CMake to use the new SOURCES_FROM_*
arguments to try_compile / try_run as added by commits cb14ae2b87
(try_compile: Add SOURCE_FROM_{ARG,VAR}, 2022-09-21) and 611d801790
(try_compile: Add SOURCE_FROM_FILE, 2022-09-22). This covers users which
previously either used an existing file (but sometimes needed to rename
it), or which wrote out their source in entirety. It does NOT cover
users that actually need configure_file functionality, as those will be
more involved to update and will thus be tackled in part 2.
2022-09-27 13:29:52 -04:00
Matthew Woehlke
2edf0fc6d7 Modules: Use new keyword-dispatched try_compile signature
Modify most of the modules that ship with CMake to use the new
try_compile / try_run signatures added by commit aa9220d3a0
(try_compile: Add keyword-dispatched signature, 2022-09-02). This
improves debugging by each invocation using its own directory so that
the results of multiple invocations can be retained.

This does not cover any invocations which provide an entire project, as
that flavor of try_compile has not yet been updated.
2022-09-14 07:52:16 -04:00
Matteo Martelli
0c638ab597 CPack: re-use paths of tools discovered by CMakeFindBinUtils
`CMakeFindBinUtils.cmake` sets `CMAKE_<TOOL>` variables that in
cross-compilation environments point to the toolchain specific
executables: e.g. `CMAKE_OBJCOPY` might point to
`<path_to_toolchain>/arm-poky-linux-gnueabi-objcopy`.
Pass this information to CPack.
2022-09-06 09:49:54 -04:00
Brad King
48a303e6f4 Merge topic 'cpack-nuget-components-on-windows'
066ff258db CPack/NuGet: Restore component packaging on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7280
2022-05-19 09:39:59 -04:00
Alex Turbov
066ff258db CPack/NuGet: Restore component packaging on Windows
The change from `\` to `/` in commit dade75509f (CPack/NuGet: Fix nuspec
file generation for UNIX-style OS, 2020-12-21, v3.20.0-rc1~243^2) does
not work on Windows.  Use `cmake_path` to form a path to an image
directory with preinstalled files.

Fixes: #22489
2022-05-18 11:12:02 -04:00
Sadie Powell
125f6964ba CPack/NSIS: Fix several typos in the NSIS template 2022-05-03 12:47:27 -04:00
Brad King
417de67afd Merge topic 'CheckCompilerFlags-revert-linker-warnings'
4941887d7d CheckCompilerFlags: Revert "Catch linker warning about ignored flags"
c2341ece47 CheckLinkerFlag: Catch linker warning when the checked flag is ignored

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7190
2022-04-22 08:55:57 -04:00
Brad King
c2341ece47 CheckLinkerFlag: Catch linker warning when the checked flag is ignored
Prior to commit 219dde4ea8 (CheckPIESupported: now uses any SYSROOT settings,
2022-01-16, v3.23.0-rc1~110^2), the checks for `-pie` and `-no_pie` on macOS
failed due to executing the compiler directly without any `-isysroot`,
producing `ld: library not found for -lc++`.  See issues #23053 and #19180.
The failing check for `-pie` was a bug because it is supported on macOS,
both for `x86_64` and `arm64`, and the commit fixed that check.

However, `-no_pie` is not supported on macOS `arm64`.  The above commit was
only able to detect that due to commit f745e0497e (CheckCompilerFlags: Catch
linker warning about ignored flags, 2022-01-03, v3.23.0-rc1~174^2), which we
need to revert due to issue #23432.  Instead, catch only the linker warning
about the exact flag being checked.
2022-04-21 11:35:30 -04:00
Brad King
c362d02e74 Merge topic 'check-flag-fembed-bitcode-conflict'
a10fc754a6 CheckSourceCompiles: Avoid linker warning with -fembed-bitcode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7156
2022-04-11 08:50:58 -04:00
Craig Scott
a10fc754a6 CheckSourceCompiles: Avoid linker warning with -fembed-bitcode
When the Apple linker sees -headerpad_max_install_names and
bitcode is enabled with a flag like -fembed-bitcode, it issues a warning
and ignores the -headerpad_max_install_names flag. This causes
unrelated compiler and linker flag checks to fail for valid flags.
In f745e0497e (CheckCompilerFlags: Catch linker warning about ignored
flags, 2022-01-03), we started detecting linker warnings, which caused
a regression for projects that were setting -fembed-bitcode in their
CMAKE_CXX_FLAGS or similar. Prevent that regression by removing
the -headerpad_max_install_names linker flag when we know it will
warn and be ignored anyway.

Fixes: #23390
Issue: #23408
2022-04-09 21:51:09 +10:00
Brad King
9cb77a6294 Merge topic 'CheckCompilerFlag-restore-env'
9dd585d12c CheckCompilerFlag: Fix regression in locale environment preservation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7153
2022-04-08 08:58:30 -04:00
Brad King
9dd585d12c CheckCompilerFlag: Fix regression in locale environment preservation
Fix a typo from commit 660e0d80ae (internal/CheckCompilerFlag: rely on
common configuration, 2022-01-12, v3.23.0-rc1~124^2~1) that caused
locale environment variables to not be restored after they are set
during the check.
2022-04-07 15:07:48 -04:00
Brad King
a20424e737 Merge topic 'productbuild-rootVolumeOnly'
2a8df7e7db productbuild: Don't write rootVolumeOnly attribute if writing domains
95eb8cbcfc CPack: Avoid space / tab mix in productbuild distribution.xml template
28fdc3a536 productbuild: Simplify internal CPACK_PRODUCTBUILD_DOMAINS usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7092
2022-03-22 08:51:02 -04:00
Brad King
73939fb3cb Merge topic 'productbuild-rootVolumeOnly' into release-3.23
2a8df7e7db productbuild: Don't write rootVolumeOnly attribute if writing domains
95eb8cbcfc CPack: Avoid space / tab mix in productbuild distribution.xml template
28fdc3a536 productbuild: Simplify internal CPACK_PRODUCTBUILD_DOMAINS usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7092
2022-03-22 08:51:01 -04:00
Brad King
c295f4a77e Merge topic 'cpack-nsis-fix-uninstall-quoting'
5d2ceaada8 CPack/NSIS: Add support for unquoted (legacy) uninstaller strings
b795c96727 CPack/NSIS: Fix uninstall command when run from installer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7096
2022-03-22 08:45:04 -04:00
Brad King
21fa99320f Merge topic 'cpack-nsis-fix-uninstall-quoting' into release-3.23
5d2ceaada8 CPack/NSIS: Add support for unquoted (legacy) uninstaller strings
b795c96727 CPack/NSIS: Fix uninstall command when run from installer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7096
2022-03-22 08:45:03 -04:00
Marc Jeanmougin
5d2ceaada8 CPack/NSIS: Add support for unquoted (legacy) uninstaller strings 2022-03-21 14:53:44 -04:00
Marc Jeanmougin
b795c96727 CPack/NSIS: Fix uninstall command when run from installer
The quoting introduced by commit eb3b3bacdc (CPack/NSIS: Fix uninstall
on Windows using "Apps & Features", 2021-09-13, v3.22.0-rc1~136^2)
created two errors in the uninstaller call: double quoting of the
uninstaller executable, and quotes added to the `_?=` argument which
does not support them.  Simplify the command.
2022-03-21 14:53:31 -04:00
Craig Scott
2a8df7e7db productbuild: Don't write rootVolumeOnly attribute if writing domains
The rootVolumeOnly attribute is deprecated. Apple docs say to use
domains instead.

Fixes: #23343
2022-03-21 15:43:46 +11:00
Craig Scott
95eb8cbcfc CPack: Avoid space / tab mix in productbuild distribution.xml template 2022-03-21 14:31:09 +11:00
Philip Bailey
114a04f89c CPack/RPM: Honor CPACK_RPM_<component>_PACKAGE_ variables when set OFF
Fixes: #23182
2022-02-08 16:23:08 -05:00
Johnny Jazeix
b56e0f4689 CPack/NSIS: Fix description not displayed for components
Fixes: #23151
2022-01-29 18:02:46 +01:00
Marc Chevrier
4fa105d34e Check{Compiler,Linker}Flag: Add possibility to retrieve check outputs 2022-01-19 10:49:23 +01:00
Marc Chevrier
9d1b9a4aa1 CheckLinkerFlag: rely now on internal implementation
This internal implementation share the configuration
with CheckCompilerFlag.
2022-01-14 23:22:07 +01:00
Marc Chevrier
660e0d80ae internal/CheckCompilerFlag: rely on common configuration
Extract configuration step from the CheckCompilerFlag command
to enable to share it with future CheckLinkerFlag implementation
2022-01-14 23:22:01 +01:00
Adriaan de Groot
d5ae2f9754 FreeBSD: fix up the package name
When using libpkg, the output filename is determined by libpkg
itself, based on information in the manifest: package name and
version, basically. This doesn't necessarily match the name that
CMake has determined via CPACK_TEMPORARY_PACKAGE_FILE_NAME or
CPACK_PACKAGE_FILE_NAME. So reset the CMake-determined list
to match what libpkg will do.
2021-12-21 13:59:27 +01:00
Brad King
4ef974e6cb CPack: Remove undocumented deprecated OSXX11 generator
This CPack generator was never documented, and has been deprecated since
commit 2ed00e8ef8 (CPack: Deprecate OSXX11 generator, 2020-01-31,
v3.17.0-rc1~45^2).

Issue: #20235
2021-11-05 12:39:22 -04:00
makise-homura
2b9ef77944 CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecture
"OS Elbrus" (OSL for short), a reference Linux distro for E2K (Elbrus)
platform may have broken dpkg-shlibdeps, that doesn't specify
dependencies correctly. In this case, the only reliable way is to
explicitly set dependencies of libc6 and lcc-libs, and then warn user
to let him know this list may be incomplete. This commit does that.
This fix has no effect on correctly working dpkg-shlibdeps, so when
this bug will be fixed in new versions of OSL, CPack will work as
expected with these distros.
2021-10-15 05:05:18 +03:00
Andras Lasso
eb3b3bacdc CPack/NSIS: Fix uninstall on Windows using "Apps & Features"
According to NSIS documentation [1], uninstaller executable path in
UninstallString must always be quoted.  Quote the uninstall executable
in `NSIS.template.in` so that it works when the path has spaces.

[1] https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs
2021-09-14 09:52:19 -04:00
Brad King
cf90aa5595 Merge topic 'host-distro-info'
b9698f89df cmake_host_system_information: Make it available for all systems
5469c71a82 Refactor: Simplify `GetValue()` function calls
6c92f80f2e cmake_host_system_information: Also set `USED_FALLBACK_SCRIPT`
efe139d1b8 cmake_host_system_information: Can run fallback scripts
1e65e4a6e5 cmake_host_system_information: Can read `/etc/os-release` file
e808cbb1dd Testing: Convert `cmake_host_system_information` tests into `RunCMake`
9e831284e5 Documentation: Use definition list instead of tables
346f3de005 Refactor: Deduplicate code for `VS_nn_DIR` keys processing
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6410
2021-08-24 10:04:15 -04:00
Alex Turbov
efe139d1b8 cmake_host_system_information: Can run fallback scripts 2021-08-20 09:35:12 -04:00
Brad King
a3ddcdb911 Merge topic 'nsis_ignore_license_page'
795e406e3b CPack/NSIS: Add option to not display license page

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6422
2021-08-03 11:06:45 -04:00
Brad King
a6eadb8031 Merge topic 'cpack-rpm-pre-semicolon'
3cdf23985f CPackRPM: avoid a spurious `;` in the `%pre` and other sections with scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6415
2021-08-03 11:01:08 -04:00
Artur Samarin
3cdf23985f CPackRPM: avoid a spurious ; in the %pre and other sections with scripts
This was accidentally added by commit 34c8a23044 (CPackRPM: add
scriplets tags only if scripts exist, 2021-04-01, v3.21.0-rc1~387^2).

Fixes: #22501
2021-08-02 15:04:22 -04:00
Johnny Jazeix
795e406e3b CPack/NSIS: Add option to not display license page
Fixes: #22215
2021-08-01 18:28:47 +02:00
Brad King
460e812369 Merge topic 'cpack-deb-lib-multiarch'
68b961d361 CPack/DEB: Add postinst/postrm ldconfig for multi-arch lib dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6341
2021-07-13 08:25:20 -04:00
Brad King
ca85c6913d Merge topic 'cpack-deb-post-ops'
805fa791d1 CPack/DEB: Avoid overriding user-provided `postinst` and `postrm`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6335
2021-07-13 08:16:26 -04:00
Alex Turbov
68b961d361 CPack/DEB: Add postinst/postrm ldconfig for multi-arch lib dirs
Fixes: #22411
2021-07-12 17:10:02 -04:00
Alex Turbov
805fa791d1 CPack/DEB: Avoid overriding user-provided postinst and postrm
When a user provides `CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA` or
`CPACK_DEBIAN_<comp>_PACKAGE_CONTROL_EXTRA` variables in
`CMakeLists.txt` and the package contains dynamic libraries, the
`CPackDeb.cmake` sets `CPACK_ADD_LDCONFIG_CALL` to `1`.  Later it
analyzes if defaulted `postinst`/`postrm` should be generated trying to
check if the user provides any in `CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA`
variable. However, the `foreach` loop uses the invalid variable
`PACKAGE_CONTROL_EXTRA` instead, so these files gonna be overridden.
Fix the variable name.

Fixes: #22410
2021-07-12 17:04:29 -04:00
Lisa Welsch
bb5fc38209 CPack/RPM: Add option to set %global __requires_exclude_from 2021-07-09 08:06:00 -04:00
Brad King
fc0a74145d Merge topic 'cpack-nsis_update-languange-list'
9ce235fe5d CPack/NSIS: Update language list in template

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6310
2021-07-08 07:56:35 -04:00
Brad King
c19b10883e Merge topic 'check_cxx_compiler_flag_no_normal_variable'
018d300ca0 Check*CompilerFlag: Do not set result as a normal variable too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6318
2021-07-08 07:49:31 -04:00
Brad King
ecd557cbd7 Merge topic 'check_cxx_compiler_flag_no_normal_variable' into release-3.21
018d300ca0 Check*CompilerFlag: Do not set result as a normal variable too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6318
2021-07-08 07:49:30 -04:00
Robert Maynard
018d300ca0 Check*CompilerFlag: Do not set result as a normal variable too
This was previously fixed by commit d46590910c (Check*CompilerFlag: Do
not set result as a normal variable too, 2020-09-21, v3.18.3~1^2^2), but
was regressed by refactoring in commit 90dead024c (CheckCompilerFlag:
unified way to check compiler flags per language, 2020-09-25,
v3.19.0-rc1~88^2) due to the changes being developed concurrently.
Fix it again, and add a test case.

Fixes: #21207
2021-07-08 07:44:03 -04:00
Marc Ruiz
9ce235fe5d CPack/NSIS: Update language list in template
Fixes: #22382
2021-07-07 11:59:49 -04:00
Alex Sweet
9b53eca317 CPack/RPM: Fix weak dep support
RPM 4.11.3 for el7 contains backported support for the RPM weak dep tags.
It only supports querying those tags, but rpmbuild can not make use of them.
Since CPack relies on rpmbuild --querytags to check for support, this
commit switches to rpm --suggests to check for support of weak
dependencies.

Fixes: #22350
2021-06-29 11:14:54 -04:00
Marc Aldorasi
701773f1da CheckCompilerFlag: Handle -Werror= for GCC 11 2021-06-17 13:39:48 -04:00
Brad King
7aad9e8685 Merge topic 'add_hip_language'
8514ee9b31 HIP: analyze output of `hipcc` to determine default GPU architecture
20d086f1a2 HIP: All HIP tests now run on CMake's current AMD hardware
2e86e50c2f HIP: Add HIP to all the Check* modules
947dbed0aa HIP: Automatically inject the `hip::device` runtime target
b50bfc8913 HIP: Add language to CMake
ff0d2858e1 HIP: Extract clang compiler details from hipcc
bd844387df ROCMClang: Add the ROCm toolkit derived clang compiler to CMake
590553f322 Compilers: protect use of  __has_include
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !6121
2021-06-09 07:53:32 -04:00