Commit Graph

12483 Commits

Author SHA1 Message Date
Brad King
68eb6fb683 Merge topic 'xcode-build-workspace'
26869fb4ba cmake --build: Fix building multiple targets in Xcode workspace

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10875
2025-06-17 09:11:48 -04:00
Brad King
e227c5a9a4 Merge topic 'fix-package-metadata-arg-parsing'
bb1e00b92c cmPackageInfoArguments: Validate new arguments
0fcea1b15e cmPackageInfoArguments: Simplify argument checking

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10885
2025-06-17 09:08:05 -04:00
Stepanov Igor
26869fb4ba cmake --build: Fix building multiple targets in Xcode workspace
Extend commit 844d79916a (cmake --build: Add support for driving Xcode
workspaces, 2025-06-02) to support multiple `--target` arguments.
`xcodebuild -scheme` cannot be repeated in a single call, so call it
multiple times instead.

Issue: #26958

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2025-06-14 16:53:25 +10:00
Matthew Woehlke
bb1e00b92c cmPackageInfoArguments: Validate new arguments
Add validation of recently added `DESCRIPTION` and `HOMEPAGE_URL`
arguments to `export`/`install` commands.
2025-06-13 14:30:46 -04:00
Brad King
eafb776fdb Tests/RunCMake/if: Suppress FilePermissions failure on CYGWIN
After a recent update, CYGWIN no longer seems to recognize execute
permission without read permission.
2025-06-13 10:36:35 -04:00
Brad King
a098f6b008 Tests/RunCMake/if: Fix FilePermissions failure message typo 2025-06-13 10:35:04 -04:00
Vito Gamberini
d71b59a4f7 install(TARGETS): Don't ignore non-extant file sets
When installing FILE_SETs, it is possible the FILE_SET has not yet been
created with target_sources(FILE_SET). Instead of ignoring this
situation, we need to track the installed FILE_SET names and their
possible install destinations.

At generation time we resolve the names and destinations concretely. If
a FILE_SET wasn't provided or isn't an INTERFACE, we silently bail out.

Fixes: #26697
2025-06-12 16:58:11 -04:00
Brad King
7dba72f9d1 Merge topic 'suppress-implicit-find-events'
c42d82d569 find_*: support suppressing implicit transition events
64f429cc4f Help/dev: add release note for implicit configure log find events
4cd83339f1 cmFindCommon: fix comment after renaming the `FullDebugMode` member

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10874
2025-06-12 09:49:16 -04:00
Ben Boeckel
c42d82d569 find_*: support suppressing implicit transition events
When projects explicitly unset variables, the transition detection can
end up reporting events when they are not desired.

See: #24833
2025-06-11 20:09:32 +02:00
Jens Carl
7ce9556acf CPack/NuGet: Set correct version for test case CPack NuGet Lib 2025-06-11 10:11:34 -07:00
Brad King
b59925a842 Merge topic 'xcode-build-workspace'
844d79916a cmake --build: Add support for driving Xcode workspaces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10855
2025-06-11 10:26:54 -04:00
Brad King
92d13b9117 Merge topic 'always-set-project-COMPAT_VERSION'
04dadd0138 Tests: Ensure project() clears unspecified properties
6171e2da90 project: Always set COMPAT_VERSION variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10871
2025-06-11 10:09:15 -04:00
Brad King
afed566a0a Merge topic 'find-events-without-debugging'
0e53a67a7b cmFindPackage: fix over-reporting
8b3fc9578a cmFindPackageCommand: report found files to debugging infra
ee062ce4d0 cmFindCommon: test implicit configure log event reporting
a90598f17c cmFindCommon: support suppressing implicit event logging
5aefc8b7b8 cmFindBase: let the debug state know if it has already been found
928a74f684 cmFindCommon: always track configure log information
4fa647a544 Tests: Match RunCMake.try_{compile,run} configure log more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10783
2025-06-11 09:56:50 -04:00
Matthew Woehlke
04dadd0138 Tests: Ensure project() clears unspecified properties
Add a unit test to ensure that various project-related variables are set
to empty when values are not provided in the project() call.
2025-06-10 15:07:29 -04:00
Ben Boeckel
0e53a67a7b cmFindPackage: fix over-reporting
Both track when a `_DIR` variable is already defined and suppress
implicit event reporting when a mode that has no reliable method for
such detection.
2025-06-10 20:01:12 +02:00
Stepanov Igor
844d79916a cmake --build: Add support for driving Xcode workspaces
External tools may create a `.xcworkspace` directory next to the
`.xcodeproj` directory that CMake generates.  If a workspace exists,
drive the build through it instead.

Closes: #26958
Co-authored-by: Brad King <brad.king@kitware.com>
2025-06-10 11:08:04 -04:00
Brad King
7d5831424b Merge topic 'ctest-show-only-json-schema'
2e7bca5f05 ctest: Add JSON schema for --show-only=json-v1 output
fe1cd4e157 Help: Make docs for ctest --show-only=json-v1 reflect the implementation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10865
2025-06-10 10:00:58 -04:00
Brad King
ed8513783c Merge topic 'instrumentation-fix'
e01d12c14f instrumentation: Prevent unnecessary query loading
f26f127183 instrumentation: Reuse single cmsys::SystemInformation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10863
2025-06-10 09:48:17 -04:00
Craig Scott
2e7bca5f05 ctest: Add JSON schema for --show-only=json-v1 output
Add schema validation to the existing test case for --show-only=json-v1 too.

Fixes: #26980
2025-06-10 07:12:31 +10:00
Ben Boeckel
ee062ce4d0 cmFindCommon: test implicit configure log event reporting 2025-06-09 12:24:32 -04:00
Ben Boeckel
5aefc8b7b8 cmFindBase: let the debug state know if it has already been found
This avoids reporting a "not found" state for searches that had cached
results.
2025-06-09 12:24:31 -04:00
Ben Boeckel
928a74f684 cmFindCommon: always track configure log information
This does mean that debug state is always around, so instead gate the
non-configure log information behind a dedicated variable.
2025-06-09 12:24:31 -04:00
Brad King
4fa647a544 Tests: Match RunCMake.try_{compile,run} configure log more precisely 2025-06-09 12:18:22 -04:00
Martin Duffy
e01d12c14f instrumentation: Prevent unnecessary query loading
Don't load queries from instrumentation directories when GetIsInTryCompile
or before ClearGeneratedQueries from previous configures has run.
2025-06-09 11:33:24 -04:00
Brad King
7fbd43c84c Merge topic 'cps-more-metadata'
da97747dac CPS: Support additional metadata
f224e131a5 CPS: Refactor metadata handling
7155903e53 cmExportPackageInfoGenerator: Fix style

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10856
2025-06-06 08:28:25 -04:00
Brad King
1824b771e9 Merge topic 'cpack-nuget-symbol-package'
e71396c8db CPack/NuGet: Enable the generation of NuGet symbol package(s)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10852
2025-06-06 08:22:00 -04:00
Brad King
91690cac34 Merge topic 'msvc-link-machine'
92d6126450 MSVC: Move link -machine flag out of CMAKE_*_LINKER_FLAGS
bb8baacbcc MSVC: Factor out link -machine flag name
4c6c7f4d45 MSVC: Move link -subsystem flag handling near and -machine flag handling
f1a80a5581 CUDA: Drop unused link rule variable setting on Windows
a0732ce47f CMAKE_STATIC_LINKER_FLAGS: Fix terminology in cache entry help string
53aab8acd6 Tests: Generalize test name RunCMake.MSVC{Warning => Default}Flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10849
2025-06-06 08:19:54 -04:00
Brad King
b01c1df41b Merge topic 'cuda-nvcc-system-includes'
d2be863b5e CUDA: Add include paths from nvcc SYSTEM_INCLUDES entry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10857
2025-06-06 08:12:49 -04:00
Brad King
dc646156d0 Merge topic 'cuda-nvcc-system-includes' into release-4.0
d2be863b5e CUDA: Add include paths from nvcc SYSTEM_INCLUDES entry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10857
2025-06-06 08:12:47 -04:00
Robert Maynard
d2be863b5e CUDA: Add include paths from nvcc SYSTEM_INCLUDES entry
Upcoming versions of nvcc are adding support for `SYSTEM_INCLUDES`
which contain includes that are implicitly used with `-isystem`
instead of `-I`.

Support of this is needed in CMake as some CUDA Toolkit releases will
start to have a different include directory layout and using only the
output from `INCLUDES` will be insufficient to find all headers.
2025-06-05 10:53:12 -04:00
Jens Carl
e71396c8db CPack/NuGet: Enable the generation of NuGet symbol package(s)
Enable the generation of NuGet symbol package(s) with the new variable
`CPACK_NUGET_SYMBOL_PACKAGE`. CPack generates then normal nuget package
(*.nupkg) and a symbol nuget package (*.snupkg). The new generate
package contains PDB files.

Fixes: #26976
2025-06-05 10:41:22 -04:00
Brad King
92d6126450 MSVC: Move link -machine flag out of CMAKE_*_LINKER_FLAGS
The `CMAKE_{EXE,SHARED,MODULE,STATIC}_LINKER_FLAGS` variables are
not language-specific, so multiple languages' toolchains may disagree
about if/how to pass the flag through a compiler driver to the linker.
Furthermore, carrying the flag in public-facing variables allows projects
or users to change it even though it is required.  Add policy CMP0197
to remove the flag from the public-facing variables and generate it
automatically instead:

* For command-line generators, add the `-machine:` flag to the
  linker and archiver rule variables.

* For Visual Studio generators, we do not need to explicitly add the
  link `-machine:` flag.  MSBuild automatically adds it, and the new
  behavior actually removes a duplicate we generated previously.

Issue: #21934
2025-06-05 09:16:54 -04:00
Brad King
727103ed9c Merge topic 'vs-Zc-defaults'
7db3dbddb2 VS: Suppress MSBuild default flags not specified by project or user

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10851
2025-06-04 11:22:26 -04:00
Brad King
e25b99a4af Merge topic 'ninja-create_def-directory'
2ec61ed01d Ninja: Fix WINDOWS_EXPORT_ALL_SYMBOLS with PRE_LINK build event

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10844
2025-06-04 11:15:32 -04:00
Matthew Woehlke
da97747dac CPS: Support additional metadata
Add support for specifying CPS's supplemental `description` and
`website` attributes. Add ability to inherit these from the `project()`,
similar to how version information can be inherited.
2025-06-03 16:50:46 -04:00
Vince Dupuis
2ec61ed01d Ninja: Fix WINDOWS_EXPORT_ALL_SYMBOLS with PRE_LINK build event
Previously the `__create_def` command could fail in cases where a
`PRE_LINK` custom command changes the working directory.

Fixes: #26973
2025-06-03 11:10:45 -04:00
Brad King
7db3dbddb2 VS: Suppress MSBuild default flags not specified by project or user
`Microsoft.Cl.Common.props` adds some `cl` flags by default, but for
CMake they may not match what's produced by command-line generators.
If the `-Zc:wchar_t`, `-Zc:forScope`, and/or `-Zc:inline` flags are
not specified by the project or user, suppress them.

Fixes: #26964
2025-06-02 14:59:38 -04:00
Matthew Woehlke
ecf81c1bc1 CPS: Get metadata from project
Modify {export,install}(PACKAGE_INFO) commands to inherit version
information from the current project in situations where it seems
reasonable to do so. Add an option to explicitly request inheritance
from a specific project.

This leverages the recently added project(COMPAT_VERSION).
2025-06-02 10:31:36 -04:00
Matthew Woehlke
9adf93d112 Tests/InstallPackageInfo: Consolidate bad arguments tests
Consolidate InstallPackageInfo's bad arguments tests into only two test
cases that each test multiple invocations, rather than having a single
test per invocation. This makes them match the similar ExportPackageInfo
tests which were necessarily consolidated due to those testing many more
variants (due to differences in the respective interfaces). This will
simplify adding additional tests in the future.
2025-06-02 10:31:36 -04:00
Brad King
53aab8acd6 Tests: Generalize test name RunCMake.MSVC{Warning => Default}Flags
Prepare to add cases for other kinds of flags.
2025-06-02 10:26:27 -04:00
Brad King
81bcc806d3 Merge topic 'allow-assigning-argument-helpers'
5eec48ee40 cmArgumentParser: Simplify assignment of marker types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10845
2025-06-02 09:18:38 -04:00
Brad King
91cdfe6676 Merge topic 'linker-launcher'
cdf2a36f48 HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER
77312cc636 CUDA: Add support for [CMAKE_]CUDA_LINKER_LAUNCHER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10847
2025-06-02 09:02:46 -04:00
Brad King
457bb06f51 Merge topic 'test-tutorial'
2d712a760e Tests: Convert Tutorial tests to RunCMake infrastructure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10843
2025-06-02 09:01:01 -04:00
Matthew Woehlke
5eec48ee40 cmArgumentParser: Simplify assignment of marker types
Explicitly allow argument markers to be assigned. Make use of this in
parsing. This simplifies working with these types, by allowing them to
be assigned from the underlying types using simple `a = b` syntax,
rather than requiring gymnastics to access the underlying assignment
operations. It also makes assignment more consistent with
initialization.
2025-05-30 11:10:41 -04:00
Maximilian Sander
cdf2a36f48 HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, CUDA, OBJC, OBJCXX, and Fortran.  Add HIP.

Closes: #26967
2025-05-30 10:05:46 -04:00
Maximilian Sander
77312cc636 CUDA: Add support for [CMAKE_]CUDA_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, OBJC, OBJCXX, and Fortran.  Add CUDA.

Issue: #26967
2025-05-30 10:00:18 -04:00
Brad King
2d712a760e Tests: Convert Tutorial tests to RunCMake infrastructure
RunCMake matches output more robustly than `PASS_REGULAR_EXPRESSION`,
and provides more details on failure.
2025-05-30 09:54:39 -04:00
Brad King
26460454b7 Merge topic 'patch-CheckCompilerFlag'
ac67631b02 Check{,C,CXX,Fortran,OBJC,OBJCXX}CompilerFlag: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10840
2025-05-30 09:35:17 -04:00
Brad King
a385cafc59 Merge topic 'renesas-compiler'
514135f563 Renesas: Add support for Renesas compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10669
2025-05-29 13:13:08 -04:00
Brad King
1c8fa92921 Merge topic 'windows-module-def-per-lang'
8b710d8264 Linker: Generate per-language module -DEF: flags on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Markus Mützel <markus.muetzel@gmx.de>
Merge-request: !10836
2025-05-29 10:11:13 -04:00