14505 Commits
Author SHA1 Message Date
Brad King 934db8d3e6 Merge topic 'FindDoxygen-terminal-and-stamp' into release-4.5
6c4a0d284e FindDoxygen: Makes USES_TERMINAL compatible with USE_STAMP_FILE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12754
2026-11-03 10:16:13 -05:00
James Miro 6c4a0d284e FindDoxygen: Makes USES_TERMINAL compatible with USE_STAMP_FILE
Fixes: #28238
2026-11-03 09:03:57 -05:00
Brad King 4daf96a1eb Tests/RunCMake/Codegen: Fix rebuild cases on make tools with 1s resolution
Revise a test from commit 36fcfb3e01 (Tests/RunCMake/Codegen: Extend
coverage, 2026-10-25, v4.5.0-rc2~4^2) to pass more reliably on such
`make` tools.
2026-11-02 11:17:46 -05:00
Brad King 9e1c78ad92 Merge topic 'source_group-fix-TREE-with-empty-path' into release-4.5
809aacdd5c source_group: TREE with empty string must be supported

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12746
2026-11-02 10:16:20 -05:00
Brad King e9767d8f79 Merge topic 'sbom-fix-uninstalled-deps' into release-4.5
2d732c85de cmSbom: Export uninstalled libraries / references to private static deps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12730
2026-11-02 10:13:20 -05:00
Aiden Woodruff fcce694567 CMAKE_TOOLCHAIN_FILE: Account for empty values when detecting changes
Initially empty CMAKE_TOOLCHAIN_FILE values should not result in an
include() statement but should be recorded to later detect changes.

Fixes: #28231
2026-10-30 13:05:16 -04:00
Marc Chevrier 809aacdd5c source_group: TREE with empty string must be supported
Fixes: #28230
2026-10-30 17:18:22 +01:00
Taylor Sasser 2d732c85de cmSbom: Export uninstalled libraries / references to private static deps
install(SBOM) could crash for dependencies outside an export set and
mishandle private dependencies expressed through LINK_ONLY.

Resolve link expressions before target lookup, traverse unexported
dependencies transitively, and isolate document state per configuration.
Preserve target license precedence and align document metadata inheritance
with CPS. Add regression coverage for these cases.

Fixes: #28141
Fixes: #28210
2026-10-30 11:12:21 -04:00
Brad King 4f7dbc9408 Merge topic 'python3.16' into release-4.5
959098d148 FindPython: Add support for Python 3.16

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12738
2026-10-30 10:17:49 -04:00
Miro Hrončok 959098d148 FindPython: Add support for Python 3.16 2026-10-29 13:32:07 -04:00
Tyler Yankee 63e7673d0b FindDoxygen: Tolerate empty output formats
Amend commit 8fc8f564c9 (FindDoxygen: Create and clean recursive
subdirectories for output formats, 2026-08-09) to avoid syntax errors
with undefined variables.

Fixes: #28222
2026-10-29 09:30:36 -04:00
Tyler Yankee 36fcfb3e01 Tests/RunCMake/Codegen: Extend coverage
Cover additional cases pertaining to add_dependencies:

* dependencies followed through an intermediate target,
* a dependency's non-CODEGEN commands must not run,
* dependencies of EXCLUDE_FROM_ALL targets are not followed,
* a dependency in an EXCLUDE_FROM_ALL subdirectory is reached.

Also verify that codegen re-runs a command only when its inputs change.
2026-10-25 19:52:43 -04:00
Tyler Yankee fe95f96096 Ninja Multi-Config: Fix cross-config codegen target suffix
The target that runs codegen for all cross-configs was named
`codegen:codegen`. Name it `codegen:all` to follow the documented
`<target>:all` convention, as the `all` target already does.

Amends commit 197cb419d1 (add_custom_command: Add CODEGEN support,
2024-05-27, v3.31.0-rc1~394^2).
2026-10-25 19:52:43 -04:00
Tyler Yankee f54117c6b1 Ninja: Evaluate generator expressions in CODEGEN outputs
Codegen is supported for Ninja Multi-Config, so CODEGEN should support
generator expressions.
2026-10-25 19:52:43 -04:00
Tyler Yankee 902ec85438 Makefile, Ninja: Fix no-op codegen builds with no CODEGEN
Ninja: Since commit 2d85779126 (Ninja: Account for explicit target
dependencies via CODEGEN, 2026-09-15, v4.5.0-rc1~162^2), a directory's
codegen phony depends on the full build of every add_dependencies
target (which caused their non-CODEGEN commands to run). Instead,
depend only on those targets' CODEGEN outputs, and follow their own
codegen dependencies in turn.

Makefiles: Since commit 197cb419d1 (add_custom_command: Add CODEGEN
support, 2024-05-27, v3.31.0-rc1~394^2), a target's `<target>/codegen`
rule used to depend on `<dep>/all` for every add_dependencies target,
which fully built them. Instead, depend on `<dep>/codegen`, except when
the target has CODEGEN commands of its own, in which case it should
still depend on `<dep>/all` as the commands may need the dependency's
outputs.

Shape up the prior `no-codegen` test case, which wasn't verifying much
of anything.

Fixes: #28205
2026-10-25 19:52:43 -04:00
Brad King dbc3ad361a Merge topic 'enable-language-subdirectory-unset-vars' into release-4.5
c32f37df2c enable_language: Include unset variables in what to propagate.
a8d1b1c06b project: Add test for platform variables with a Generic system

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Vito Gamberini <vito.gamberini@kitware.com>
Merge-request: !12701
2026-10-24 11:31:52 -04:00
Brad King ef3c04bd1e Merge topic 'fix-fdo-pkg-config' into release-4.5
511ac7ecd7 FindPkgConfig: Query prefix separately from modversion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12699
2026-10-24 11:28:31 -04:00
Brad King 1579b78ba1 Merge topic 'fix-cps-props' into release-4.5
111bbed7ae CPS: Apply imported compile and link properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12697
2026-10-24 11:26:41 -04:00
Robert Maynard a8d1b1c06b project: Add test for platform variables with a Generic system
Cover that `UNIX`, `LINUX`, and other host platform variables are not
defined after `project()` when `CMAKE_SYSTEM_NAME` is `Generic`.

Issue: #28200
2026-10-23 13:15:58 -04:00
Vito Gamberini 511ac7ecd7 FindPkgConfig: Query prefix separately from modversion
FDO pkg-config does not allow multiple output modes like --modversion
and --variable in the same query. Split them up into two separate
queries while retaining batching for the rest of the flags.

Fixes: #28194
2026-10-23 11:17:20 -04:00
Brad King 21957313f5 Merge topic 'custom-rule-callbacks-in-configure-step' into release-4.5
ccc15ac21c Custom rule: ensure user's callbacks are executed during config step

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12689
2026-10-23 09:22:41 -04:00
Vito Gamberini 111bbed7ae CPS: Apply imported compile and link properties
Fixes: #28198
2026-10-22 17:23:15 -04:00
Marc Chevrier ccc15ac21c Custom rule: ensure user's callbacks are executed during config step 2026-10-22 23:10:38 +02:00
Vito Gamberini c60a7c7cff c++modules: Don't add interface BMI objects to unscanned targets
Fixes: #28197
2026-10-22 13:29:54 -04:00
Brad King 399d2eccba Merge topic 'gnuinstalldirs-opt-double-slash' into release-4.5
0f585d056c GNUInstallDirs: Fix double separator in /opt special-case absolute paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12673
2026-10-21 15:33:25 -04:00
Mike Matthews 0f585d056c GNUInstallDirs: Fix double separator in /opt special-case absolute paths
Since commit 7566a477f7 (GNUInstallDirs: Factor out helper for special
absolute path logic, 2025-03-27, v4.1.0), when CMAKE_INSTALL_PREFIX is
under /opt/ (excluding /opt/homebrew), the special case FHS directories
include an extra path separator, resulting in values like /etc//opt/foo.
This is observed in CMAKE_INSTALL_FULL_SYSCONFDIR,
CMAKE_INSTALL_FULL_LOCALSTATEDIR, and CMAKE_INSTALL_FULL_RUNSTATEDIR
whenever their corresponding CMAKE_INSTALL_<dir> may be relative, as is
the case under policy CMP0192 OLD or if set explicitly while under
CMP0192 NEW (e.g. -DCMAKE_INSTALL_SYSCONFDIR=etc). Restore the previous
path calculation, which relies on the prefix starting with `/`.

Fixes: #28186
2026-10-20 14:12:09 -04:00
Brad King 9135950e63 Merge topic 'fix-msvc-import-std-compat' into release-4.5
af81311ce6 c++modules: Fix transitive import of object producing BMIs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12671
2026-10-19 14:30:47 -04:00
Brad King be90d21016 Merge topic 'fix-target-FILE_SET-properties' into release-4.5
0adc84cf73 Fix target FILE_SET properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12667
2026-10-19 13:36:01 -04:00
Vito Gamberini af81311ce6 c++modules: Fix transitive import of object producing BMIs
Fixes: #28185
2026-10-18 12:10:56 -04:00
Marc Chevrier 0adc84cf73 Fix target FILE_SET properties
Ensure custom rules are taken into account.
2026-10-17 13:37:32 +02:00
Taylor Sasser 1b81737dea install: Restore support for missing COMPONENT argument value
Since commit 8997bb6431 (install: Parse SCRIPT and CODE arguments with
cmArgumentParser, 2026-08-14, v4.5.0-rc1~190^2) a missing argument to
`install(... COMPONENT)` is an error.  Restore the default to the
"Unspecified" component as before.

Fixes: #28177
2026-10-16 15:19:54 -04:00
Brad King 89fa36af1a Merge topic 'enable-test_prep-by-default' into release-4.5
4bbdabae74 Ninja, Makefile, FASTBuild: Enable test_prep by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12638
2026-10-15 10:48:14 -04:00
Brad King 969d89ae0f Merge topic 'cpack-deb-control-compression' into release-4.5
c98126d433 CPack/DEB: Do not use lzma or bzip2 compression for control.tar

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Overchenko <aleksandr9809@gmail.com>
Merge-request: !12644
2026-10-15 10:40:04 -04:00
Brad King a3a61a21fe Merge topic 'fix-compilation-db-proc-metric' into release-4.5
7690970a9c Ninja: Remove shell workaround from compilation database

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12646
2026-10-15 10:37:57 -04:00
Brad King a924bde521 Merge topic 'ninja-mc-test-install-prep' into release-4.5
3882e26cef Ninja Multi-Config: Provide {test,install}_prep default config aliases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12645
2026-10-15 10:32:30 -04:00
Brad King 98ff37f09f Merge topic 'LLVMFlang-Apple-Flang-18-19' into release-4.5
45208d7353 LLVMFlang: Support Flang 18 and 19 on Apple platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12642
2026-10-15 10:30:12 -04:00
Brad King 04cfaa5d25 Merge topic 'xcode-pch-force-include' into release-4.5
36cc0ac76c Xcode: Fix precompiled headers with user-specified force includes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12615
2026-10-15 10:27:12 -04:00
Matthew Woehlke 4bbdabae74 Ninja, Makefile, FASTBuild: Enable test_prep by default
Enable test preparation targets by default. Add (better named)
`CMAKE_SKIP_TEST_PREP_TARGETS` variable to control generation of the
same, mirroring `CMAKE_SKIP_INSTALL_PREP_TARGETS`. Remove support for
old `CMAKE_TEST_BUILD_DEPENDS` variable. Update and improve
documentation.

This improves consistency between test and install preparation targets.
It also modifies the descriptions of preparation targets in the
documentation of generators which support them to be consistent.
(Previously, each generator described preparation targets in a manner
unique to each generator.)

Fixes: #28050
2026-10-14 16:10:45 -04:00
Martin Duffy 7690970a9c Ninja: Remove shell workaround from compilation database
Commit 1528113bdf (instrumentation: Prevent inherited process metrics in
chained commands, 2026-09-14) added an extra command to successfully
track process metrics for instrumentation, working around shell exec
optimizations . However, this workaround gets exported into
`compile_commands.json` when using the Ninja generator, which breaks
some tools that consume the database.

Append this no-op command only when generating the actual build files.
2026-10-14 10:44:39 -04:00
Olaf Mandel c98126d433 CPack/DEB: Do not use lzma or bzip2 compression for control.tar
Since commit 57eed59f35 (CPack/DEB: Use the same compression type for
control tar, 2025-07-29), control.tar uses CPACK_DEBIAN_COMPRESSION_TYPE.
deb(5) allows lzma and bzip2 only for data.tar, so dpkg rejects packages
built with either type.  Fall back to gzip for control.tar in those cases,
as before that commit.

Fixes: #28169
2026-10-14 10:42:42 -04:00
Brad King 07ebd37501 Merge topic 'add-dpclang' into release-4.5
c7ab581812 ci: Add job testing DPClang on Linux
4ea5eba8de ci: Add scripts to install DPClang in Linux jobs
21213ae1d9 DPClang: add compiler support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12634
2026-10-14 10:39:39 -04:00
Brad King b341720cbf Merge topic 'file-DIFFERENT-doc' into release-4.5
f030dcf26a Help: Document file(DIFFERENT)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12632
2026-10-14 10:35:25 -04:00
Cristian Adam 36cc0ac76c Xcode: Fix precompiled headers with user-specified force includes
The Xcode generator implements `target_precompile_headers()` through the
`GCC_PREFIX_HEADER` build setting, so Clang receives the prefix header as
an `-include` flag and finds the precompiled `.gch` next to it.  Clang
honors that only when it is the first `-include` flag.  Xcode extracts
every `-include <file>` pair out of settings such as `OTHER_CFLAGS` and
places it on the command line ahead of the prefix header, so a force
include added by the project always came first and the precompiled header
was dropped:

  precompiled header '.../cmake_pch.hxx.gch' was ignored
  because '-include .../cmake_pch.hxx' is not first '-include'

Pass such flags straight to the compiler front end as a single joined
`-Xclang -include<file>` argument instead.  Xcode does not recognize it as
a force include and leaves it in the response file, and the driver no
longer sees an `-include` flag of its own, so the prefix header stays
first.  The header is still force included: Xcode compiles the prefix
header in a step of its own, in which every force include, `-Xclang` or
not, is processed before the prefix header itself.

Rewrite every spelling Clang accepts, joined ones such as `-include<file>`
and `--include=<file>` included, since the driver recognizes them all.
Leave alone a flag already handed to a sub-tool with `-Xclang` or
`-Xpreprocessor`, as well as one whose value looks like another flag.

`GCC_PREFIX_HEADER` is a target-wide setting, so apply the rewrite to
every language compiled in the target, not just the one the precompiled
header was requested for.  Do it where the `OTHER_*FLAGS` strings are
assembled so that the define flags are covered too.  Only rewrite for
languages the prefix header applies to, and for compilers that understand
`-Xclang`.

Fixes: #23259
2026-10-14 16:01:43 +02:00
Brad King a774a672ef Merge topic 'fileset-LANGUAGE-property' into release-4.5
e529a41ae5 Extend support of file set LANGUAGE property to custom rules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12637
2026-10-14 09:58:50 -04:00
Brad King 2f9ae01f5e Merge topic 'fortran-split-token' into release-4.5
a9243f6a02 Fortran: Join identifiers split across continuation lines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12628
2026-10-14 09:45:23 -04:00
Daksh Mamodiya f030dcf26a Help: Document file(DIFFERENT)
It has been around since CMake 2.6.3 for generated install scripts but
was never documented.  Added a test for the result too, since nothing
checked it before.

Fixes: #28154
2026-10-14 15:43:31 +02:00
Daksh Mamodiya 45208d7353 LLVMFlang: Support Flang 18 and 19 on Apple platforms
Flang gained -Xlinker only in LLVM 20, so the Apple linker flags added
by commit 18d65b9d4b (LLVMFlang: Fix Fortran shared library creation on
Apple platforms, 2026-09-23) fail with older Flang.  For those versions
the flags now go through -Wl, with the install name joined to its flag.
Flang 20 and later keep the -Xlinker form.

Fixes: #28148
2026-10-14 09:35:43 -04:00
Tyler Yankee 3882e26cef Ninja Multi-Config: Provide {test,install}_prep default config aliases
Fixes: #28168
2026-10-14 09:12:56 -04:00
Vito Gamberini 21213ae1d9 DPClang: add compiler support
Fixes: #28157
2026-10-13 14:59:23 -04:00
Marc Chevrier e529a41ae5 Extend support of file set LANGUAGE property to custom rules
In case of file set attached to custom rules, the semantic of this
property is defined by the custom rule.
2026-10-13 17:56:23 +02:00