Commit Graph

171 Commits

Author SHA1 Message Date
Brad King
4ac5a2f866 CMakePackageConfigHelpers: Add generate_apple_architecture_selection_file()
Add a helper to select architecture-specific implementations of a
package on an Apple-specific platform.

Fixes: #25516
2023-12-19 08:56:30 -05:00
Brad King
3b9586671c CMakePackageConfigHelpers: Clarify Apple platform selection template name
The template added by commit 37bc3400cd (CMakePackageConfigHelpers: Add
generate_apple_platform_selection_file(), 2023-11-03) is specific to
Apple platforms.  Give it an Apple-specific name.
2023-12-18 14:28:34 -05:00
Brad King
3148db4533 CMakePackageConfigHelpers: Fix Apple platform selection for tvOS
Fix the tvOS SDK name in commit 37bc3400cd (CMakePackageConfigHelpers:
Add generate_apple_platform_selection_file(), 2023-11-03).
2023-12-15 16:33:22 -05:00
Brad King
df025444b2 LinkerId: Identify AIX and SunOS system linkers
Populate `CMAKE_<LANG>_COMPILER_LINKER_{ID,VERSION}` on these platforms.
2023-12-08 16:32:20 -05:00
Brad King
c1e48a19a5 LinkerId: Try multiple flags to detect linker id and version
In general there is no one flag on any platform that can identify every
linker.
2023-12-08 15:50:11 -05:00
Brad King
1e42a0cf18 LinkerId: Match linker id and version more robustly
Extract version number output only after explicitly matching it.
2023-12-08 15:48:15 -05:00
Brad King
f23636617a CMakePackageConfigHelpers: Move platform selection template to Internal/
The template added by commit 37bc3400cd (CMakePackageConfigHelpers: Add
generate_apple_platform_selection_file(), 2023-11-03) is a private
implementation detail.  Move it to `Modules/Internal/`.
2023-12-07 16:54:09 -05:00
Brad King
a1dcc36f65 Merge topic 'rpm-quoting'
5123e9e160 ci: unmask RPM tests on Fedora 39
bf22ac5263 CPack/RPM: Quote paths in rpm spec only if they have whitespace
75ea6207b7 CPack/RPM: Factor out helper to quote paths in generated rpm spec

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9005
2023-11-30 09:05:54 -05:00
Brad King
bf22ac5263 CPack/RPM: Quote paths in rpm spec only if they have whitespace
RPM supports either whitespace with quoting or globbing without quoting.
Prior to RPM 4.19 it accepted globbing in quotes, but it only globbed
correctly without whitespace, where quoting was not necessary anyway.
Starting in RPM 4.19, glob characters in quotes are considered literal.

Fixes: #25421
Inspired-by: Ben Boeckel <ben.boeckel@kitware.com>
See: d44114f007
2023-11-29 12:47:20 -05:00
Brad King
75ea6207b7 CPack/RPM: Factor out helper to quote paths in generated rpm spec 2023-11-29 12:27:31 -05:00
Brad King
c40e242be3 Merge topic 'cpack-auto-suffixes'
53991e62da CPack/RPM: Append .rpm to CPACK_RPM_FILE_NAME if missing
f2a6d423da CPack/DEB: Append .deb to CPACK_DEBIAN_FILE_NAME if missing
907d4db558 Help: Format allowed CPACK_{DEB,RPM}_FILE_NAME values as definition list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8880
2023-11-28 09:45:53 -05:00
Alex Neundorf
53991e62da CPack/RPM: Append .rpm to CPACK_RPM_FILE_NAME if missing
Previously we issued an error when the `.rpm` suffix is missing.
Instead, append the suffix automatically.  This matches the behavior of
`CPACK_ARCHIVE_FILE_NAME`, to which the archive format suffix is
automatically appended.  With this change, developers can simply do

    set(CPACK_RPM_comp_FILE_NAME "${CPACK_ARCHIVE_comp_FILE_NAME}")
2023-11-27 10:26:37 -05:00
Alex Neundorf
f2a6d423da CPack/DEB: Append .deb to CPACK_DEBIAN_FILE_NAME if missing
Previously we issued an error when the `.deb` or `.ipk` suffix
is missing. Instead, append the suffix `.deb` automatically.
This matches the behavior of `CPACK_ARCHIVE_FILE_NAME`, to
which the archive format suffix is automatically appended.
2023-11-27 10:25:43 -05:00
Brad King
4c1a6f2e23 Merge topic 'ci-fedora-39'
cdd741ebf9 Merge branch 'backport-ci-fedora-39' into ci-fedora-39
9283b20659 ci: Suppress CPack/RPM tests pending fix for Fedora 39
18145e8745 ci: Update FindMPI test environment for mpich on Fedora 39
a8be80ccf2 ci: Drop now-unnecessary Clang rules for CXXModules tests
99238b23e9 ci: use Fedora 39 images and environments
57eadec617 ci: update Linux image to Fedora 39
653262162c clang-tidy module: Update to build against LLVM/Clang 17
2cf9a65835 clang-tidy: ignore warnings new in version 17
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8983
2023-11-20 08:10:37 -05:00
Brad King
cdd741ebf9 Merge branch 'backport-ci-fedora-39' into ci-fedora-39 2023-11-17 11:35:41 -05:00
Brad King
2744f14db1 codespell: Fix typos 2023-11-17 09:58:21 -05:00
Max Gaukler
60661f6770 CPack/WiX: Make InstallScope configurable
Add a new `CPACK_WIX_INSTALL_SCOPE` variable to set the `InstallScope`
when using the default WiX template.  Set the default to the bug-free
value `perMachine`.

Fixes: #20962
2023-11-16 14:15:38 -05:00
Brad King
f0feefceb3 Merge branch 'backport-cuda-vs' into cuda-vs 2023-11-01 13:51:51 -04:00
Brad King
27e64a8498 CMakeNVCCParseImplicitInfo: Recognize link.exe line in CUDA VS integration 2023-11-01 13:51:10 -04:00
Marc Chevrier
c26c6ac488 Link Step: compute effective linker used by the compiler
Extract the effective linker during the computation of implicit artifacts
delivered by the compiler to the linker.
Define various variables describing the linker:
* CMAKE_<LANG>_COMPILER_LINKER
* CMAKE_<LANG>_COMPILER_LINKER_VERSION
* CMAKE_<LANG>_COMPILER_LINKER_ID
* CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT

This is complementary to feature introduced by commit 96a953b1ed
(Add options to specify linker tool, 2023-09-27).

Fixes: #17596, #18209, #25344
2023-10-24 08:34:50 -04:00
Brad King
b3a1f17567 CUDA: Factor out helper to validate CMAKE_CUDA_ARCHITECTURES
Prepare to use it for other languages.
2023-09-21 15:34:28 -04:00
Brad King
8617c28221 CUDA: Factor out helper for detecting native CUDA architectures
Prepare to use it for other languages.
2023-09-21 15:34:28 -04:00
Brad King
0db0fe7958 CUDA: Factor out helper to compute all CUDA architectures
Prepare to use it for other languages.
2023-09-21 15:34:28 -04:00
Brad King
c16f1e2b93 CUDA: Factor out helper to find CUDA Toolkit for compiler
Prepare to use it for other languages.
2023-09-21 15:34:28 -04:00
Brad King
a6841a967b CUDA: Factor out helper to filter implicit link libraries
Prepare to use it for other languages.
2023-09-21 15:34:27 -04:00
Brad King
deff0e638d CUDA: Factor out helper to parse NVCC implicit compiler and linker flags
Prepare to use it for other languages.
2023-09-21 15:34:27 -04:00
Sprite
d3bfe0ea44 CPack/NSIS: Fix incorrect jump for standard user
Revert an incorrect change from commit c4a0bcea77 (CPack: Fix NSIS
handling of privileged users, 2012-02-01, v2.8.8~230^2).

Fixes: #13939
2023-09-05 13:39:00 -04:00
Ben Boeckel
04300579dd Modules/Internal/FeatureTesting: mark feature testing as a special test 2023-07-31 11:37:47 -04:00
Brad King
04b0d5c862 codespell: Fix typos 2023-05-22 16:51:15 -04:00
Jannik Alber
1d6db66179 CPack: Add Inno Setup generator 2023-04-28 09:33:28 -04:00
Brad King
c77801029d Merge topic 'revert-CheckCompilerFlag-clang-argument-unused'
97fcd3bd30 CheckCompilerFlag: Revert 'Match the Clang "argument unused" output ...'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8322
2023-03-14 09:29:01 -04:00
Brad King
97fcd3bd30 CheckCompilerFlag: Revert 'Match the Clang "argument unused" output ...'
Revert commit 5b45a3d0ce (CheckCompilerFlag: Match the Clang "argument
unused" output for all languages, 2023-01-23, v3.26.0-rc1~38^2).  It
broke existing projects that were silently tolerating unrelated unused
arguments in their checks for C and CXX.  For example, using
`CFLAGS=-nostdinc` or `CXXFLAGS=-nostdinc++` causes those flags to be
used when driving the linker as well, and Clang warns they are unused in
that case.

Add a test case covering the now-restored behavior.

Fixes: #24591
2023-03-13 16:18:50 -04:00
scivision
f3e85754b4 Modules:Check*: refactor: use block(SCOPE_FOR POLICIES) 2023-03-08 14:07:55 -05:00
KOLANICH
5b45a3d0ce CheckCompilerFlag: Match the Clang "argument unused" output for all languages
Improve detection of missing compiler flags: move "argument unused
during compilation: .*" pattern from language-specific branches into
the common list.
2023-01-24 17:17:36 -05:00
Brad King
f6ed2585e5 Modules: Record system inspection steps in the configure log
Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging
with calls to `message(CONFIGURE_LOG)` to record the steps in the
`CMakeConfigureLog.yaml` configure log instead.

Issue: #23200
2023-01-18 17:59:10 -05:00
Brad King
0f688386ea Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log
`try_compile` and `try_run` now automatically log checks using them to
`CMakeConfigureLog.yaml`.

Add `LOG_DESCRIPTION` arguments to some `try_compile` calls to
replace the description previously written to the old logs.

Issue: #23200
2023-01-18 16:41:01 -05:00
Brad King
9199449687 CompileFeatures: Warn explicitly when feature detection binary is not found
This step is not normally expected to fail, so warn instead of logging it.
2023-01-18 16:41:00 -05:00
Vitaly Stakhovsky
99614e06be Source: Fix a few typos 2023-01-17 08:25:04 -05:00
Evan Wilde
2d5403ecaa CheckCompilerFlag: Add Swift Support
Plumb through Swift `check_compiler_flag` support.
Add tests to check that valid flags work and invalid flags don't.
2022-11-04 09:32:06 -07:00
Evan Wilde
3fc971c38b CheckSourceCompiles: For Swift executable, name source 'main.swift'
Xcode uses its own heuristics to determine whether or not to accept
top-level code in a source file while Ninja uses the swift driver
heuristics.

With the Swift driver, if the module contains a single file, that file
will be parsed as a top-level code context. With Xcode, the single file
will only be parsed as top-level code if the name of that file is
'main.swift'.

To ensure more consistent behavior between the two generators, if we're
building Swift and the try-compile target type is executable or
undefined, we name the file `main.swift` to ensure that both will handle
the single file as top-level code.
2022-10-24 12:39:21 -04:00
Evan Wilde
2345139ab5 CheckSourceCompiles: Add support for Swift
Plumb through swift `check_source_compiles` support.  Add tests to check
that valid swift sources compile and invalid sources don't.
2022-10-24 12:39:21 -04:00
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