Commit Graph

103 Commits

Author SHA1 Message Date
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
Robert Maynard
2e86e50c2f HIP: Add HIP to all the Check* modules 2021-06-07 19:25:33 +00:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Ben Boeckel
ed1f3a5fa5 CPackDeb: output the error message when no description can be made
The `message` command does not support automatic dereferencing.
2021-06-07 07:11:44 -04:00
Markus Israelsson
79f48da5c2 CPack/NSIS: Fix CPACK_NSIS_UNINSTALL_NAME when not Uninstall.exe
If a previous installation was detected by the NSIS script the
uninstaller was not correctly run unless it was still named
`Uninstall.exe`.  This meant that using `CPACK_NSIS_UNINSTALL_NAME`
was simply broken.

Fixes: #22103
2021-04-27 14:06:42 -04:00
Domen Vrankar
34c8a23044 CPackRPM: add scriplets tags only if scripts exist
Scriplet tags should not be added to generated
spec files if scripts weren't provided as those
tags are otherwise present in generated rpm file
even if the script wasn't provided thereby
generating unneeded dependency on shell.

Fixes: #21345
2021-04-01 22:28:24 +02:00
Brad King
ac79fd8a0e Merge topic 'cpackrpm-debuginfo-single-package-install-erase-scripts'
31c184ad69 CPackRPM: handle scripts in debuginfo single package mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5953
2021-04-01 10:25:28 -04:00
Domen Vrankar
31c184ad69 CPackRPM: handle scripts in debuginfo single package mode
Enabling CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE while
using rpm install or erase scripts resulted in
resulted missing scripts for non default components.

Fixes: #21974
2021-03-30 23:24:16 +02:00
Domen Vrankar
d0adb2386a CPackRPM: correctly handle empty dir in single package mode
Enabling CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE while
having an empty directory in non main component
resulted in packaging error that the directory
does not exist.

Fixes: #21951
2021-03-29 01:26:58 +02: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
Deniz Bahadir
d586a4ad60 CPackDeb: dpkg-shlibdeps now supports searching for private shared libs
The new CPack variable `CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS`
can be set to a list of directories. If `CPACK_DEBIAN_PACKAGE_SHLIBDEPS`
or `CPACK_DEBIAN_<component>_PACKAGE_SHLIBDEPS` are set to `ON` these
directories will be searched by `dpkg-shlibdeps` in order to find
private shared library dependencies of the libraries/executables that
shall be packed.
2021-01-22 08:33:01 -05:00
iorikyu
dade75509f CPack/NuGet: Fix nuspec file generation for UNIX-style OS
Use forward slashes, which should work on both UNIX and Windows.
2020-12-22 09:30:33 -05:00
Brad King
5ef2364053 Merge topic 'correct_check_compiler_flag_regression' into release-3.19
72f6b4bfbe Modules: Rename Internal/CMake{CheckCompiler => TryCompilerOrLinker}Flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kumar Gala <kumar.gala@gmail.com>
Merge-request: !5540
2020-11-30 12:37:14 -05:00
Brad King
0a9f19c0ea Merge topic 'correct_check_compiler_flag_regression'
72f6b4bfbe Modules: Rename Internal/CMake{CheckCompiler => TryCompilerOrLinker}Flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kumar Gala <kumar.gala@gmail.com>
Merge-request: !5540
2020-11-30 12:37:14 -05:00
Brad King
b13961fb0f Merge topic 'check-lang-conditions'
f3d4254b3d Check*: Tolerate variables set with names of languages
01d91ae5f2 Tests: Fix RunCMake.Check* conditions for enabling Fortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !5536
2020-11-30 12:34:31 -05:00
Robert Maynard
72f6b4bfbe Modules: Rename Internal/CMake{CheckCompiler => TryCompilerOrLinker}Flag
Rename the `CheckPIESupported` helper functions so that they
don't clobber other internal functions. Also rename them to
document they can't be unified with `CheckCompilerFlag`.

Fixes: #21497
2020-11-25 11:06:15 -05:00
Brad King
f3d4254b3d Check*: Tolerate variables set with names of languages
Fix the language checks added by commit 90dead024c (CheckCompilerFlag:
unified way to check compiler flags per language, 2020-09-25,
v3.19.0-rc1~88^2), commit 10ae907de0 (CheckSoureCompiles: Add a unified
way to check if a source compiles, 2020-09-14, v3.19.0-rc1~118^2~1), and
commit 357e2ef429 (CheckSoureRuns: Add a unified way to check if a
source runs, 2020-09-14, v3.19.0-rc1~118^2) to work when variables of
the language names are set.

Fixes: #21500
2020-11-25 09:11:21 -05: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
Brad King
02d6c98210 Merge topic 'cpack-nuget'
41ae7c4e51 CPack/NuGet: Add settings for the license, icon, and language

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5415
2020-11-06 08:01:41 -05:00
Bob Apthorpe
41ae7c4e51 CPack/NuGet: Add settings for the license, icon, and language
Also update the XML Schema.

Fixes: #21348
2020-11-05 10:49:25 -05:00
Brad King
301d82a6ae Merge topic 'CheckSourceRuns-compatibility'
a524bf3aa7 CheckSourceRuns: do not fail on unrecognized arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5426
2020-10-30 09:51:35 -04:00
Ben Boeckel
a524bf3aa7 CheckSourceRuns: do not fail on unrecognized arguments
The old `check_X_source_runs` modules did not verify the arguments, so
we cannot start doing it now. Downgrade the hard error introduced in
commit 357e2ef429 (CheckSoureRuns: Add a unified way to check if a
source runs, 2020-09-14) via !5223 into a noisy warning.
2020-10-28 15:06:02 -04:00
Brad King
967fb42d47 Merge topic 'check-module-name-conflicts'
d192918586 Modules: Do not implicitly add new functions via old Check Modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5424
2020-10-27 07:02:50 -04:00
Robert Maynard
d192918586 Modules: Do not implicitly add new functions via old Check Modules
The conversion of Check<Lang>CompilerFlag, SourceCompiles, and
SourceRuns over to the new functions has the possibility of breaking
projects that had functions with those existing names.

To reduce the possibility of collisions we now have all the
legacy code call functions that start with `cmake_`, and users
will need to explicitly include the new modules to get the
non-prefixed versions

Fixes: #21359
2020-10-26 10:57:55 -04:00
Johnny Jazeix
c92b96234a CPack/NSIS: Template file in UTF-8 BOM to support Unicode
Fixes: #21318
2020-10-19 19:53:56 +02: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
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Raul Tambre
6636693134 FindCUDAToolkit: Re-unify with Internal/CUDAToolkit
A portion of FindCUDAToolkit was previously split in commit dc2eae1f
(FindCUDAToolkit: Factor out discovery code into a separate file, 2020-04-22)
out into Internal/CUDAToolkit to allow re-use of the code in
CMakeDetermineCUDACompiler for Clang support.

This has turned out to be a bad solution due to Clang requiring quite a bit of
special handling and special handling for NVCC leaking out from
Internal/CUDAToolkit into the Clang code using it.

Thus it seems better to re-unify this code and duplicate the parts of the code
necessary for Clang where it's required. This will help us get logic correct
for both NVCC and CUDA handling. We can still unify the common parts in the
future once the code has matured.
2020-06-12 21:49:15 +03:00