76906 Commits

Author SHA1 Message Date
Brad King
fd093f59e7 Merge topic 'string-json-array-split'
7cca8540ca string(JSON): Add ARRAY_SPLIT mode for linear array iteration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12386
2026-08-08 10:49:20 -04:00
Brad King
3fdafa3302 Merge topic 'windows-toolchain-input'
f5837208f5 CMAKE_TOOLCHAIN_FILE: Fix Windows saved input toolchain file syntax error
996fc21020 Tests: Enable toolchain parts of RunCMake.CompilerChange on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12382
2026-08-08 10:47:50 -04:00
Brad King
628ceffe6b Merge topic 'enable-language-subdirectory'
86759dce81 enable_language: add support for usage in subdirectories
220fc8622d block: Fix incorrect policy scope creation order

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12222
2026-08-08 10:45:42 -04:00
Brad King
2c517aafb1 Merge topic 'msys-make-no-ar'
0e883c5753 MSYS Makefiles: Drop outdated enforcement of archiver availability

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12384
2026-08-08 10:44:09 -04:00
Brad King
fb400dcd54 Merge topic 'update-kwsys'
5eb3244260 Merge branch 'upstream-KWSys' into update-kwsys
40ee224f0a KWSys 2026-08-08 (ea3b2a5a)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12385
2026-08-08 10:41:34 -04:00
Brad King
5eb3244260 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2026-08-08 (ea3b2a5a)
2026-08-08 10:32:50 -04:00
KWSys Upstream
40ee224f0a KWSys 2026-08-08 (ea3b2a5a)
Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit ea3b2a5a965edbc762ff8c3331742603d054bc37 (master).

Upstream Shortlog
-----------------

Brad King (3):
      badc3d09 Process: Fix compilation on Windows with WIN32_LEAN_AND_MEAN
      c54df4be cmake: Modernize add_definitions calls to add_compile_definitions
      1cda2290 cmake: Compile with WIN32_LEAN_AND_MEAN on Windows

Matthew Woehlke (2):
      d5b086a9 SystemTools: Fix compilation on Windows with WIN32_LEAN_AND_MEAN
      bd32c8f4 SystemInformation: Fix compilation on Windows with WIN32_LEAN_AND_MEAN
2026-08-08 10:32:49 -04:00
Brad King
2e85f43db1 Merge topic 'update-kwsys'
f188f74bbd KWSys: update for `CopyWhen::{Always => Unconditional}` rename
4684e97400 Merge branch 'upstream-KWSys' into update-kwsys
0add8c6329 KWSys 2026-08-08 (19691df6)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12383
2026-08-08 10:30:05 -04:00
Ben Boeckel
f188f74bbd KWSys: update for CopyWhen::{Always => Unconditional} rename
KWSys renamed `Always` to `Unconditional` because the former
conflicts with a X11 macro.
2026-08-08 10:25:19 -04:00
KWSys Upstream
0add8c6329 KWSys 2026-08-08 (19691df6)
Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit 19691df656b78097f5ad9d810b068fa3df73e023 (master).

Upstream Shortlog
-----------------

Ben Boeckel (1):
      6a287bb5 SystemTools: rename `CopyWhen::{Always => Unconditional}`
2026-08-08 10:25:00 -04:00
Brad King
4684e97400 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2026-08-08 (19691df6)
2026-08-08 10:25:00 -04:00
Aiden Woodruff
f5837208f5 CMAKE_TOOLCHAIN_FILE: Fix Windows saved input toolchain file syntax error
The value of _CMAKE_INPUT_TOOLCHAIN_FILE can contain backslashes when
Windows path separators are used. This commit ensures regression tests
check such cases and saves the value with a bracket argument to avoid
causing a syntax error due to the backslashes.

Fixes: #28024
2026-08-07 13:04:14 -04:00
Aiden Woodruff
996fc21020 Tests: Enable toolchain parts of RunCMake.CompilerChange on Windows
A regression was missed partially due to this suite's condition. The
compiler specific pieces still need this condition because a shell
script needs to pretend to be a compiler, but the toolchain parts are
platform agnostic.

Issue: #28024
2026-08-07 13:03:49 -04:00
Brad King
ebd3af92f9 Merge topic 'print_variables'
4f09a029dc cmake_print_variables: Deprecate in favor of cmake_language(PRINT_VARIABLES)
a06658b6d7 cmake_language: Add PRINT_VARIABLES operation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12160
2026-08-07 11:48:00 -04:00
Daksh Mamodiya
7cca8540ca string(JSON): Add ARRAY_SPLIT mode for linear array iteration
Iterating a JSON array with GET re-parses the entire string on every
call, so walking N elements is O(N^2).  ARRAY_SPLIT parses the array
once and returns its elements as a CMake list, letting each element be
queried individually in linear total time.

Each element is re-serialized as compact JSON and encoded to survive
CMake list parsing: '[' and ']' inside strings are emitted as \u005B
and \u005D, and ';' is escaped as '\;'.  Every element therefore stays
valid, re-queryable JSON.

Fixes: #27985
2026-08-07 17:45:50 +02:00
Brad King
bbad94e703 Merge topic 'update-kwsys'
ebe735cc3c Merge branch 'upstream-KWSys' into update-kwsys
8931545843 KWSys 2026-08-07 (1c806117)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12377
2026-08-07 11:20:11 -04:00
KWSys Upstream
8931545843 KWSys 2026-08-07 (1c806117)
Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit 1c8061173731a42a3c1d03abcf261891b493de28 (master).

Upstream Shortlog
-----------------

Matthew Woehlke (3):
      d1a5a40e DynamicLoader: Homogenize platform checks
      49197699 DynamicLoader: Fix use of `0` as null pointer
      81ccb00a DynamicLoader: Add (and use) invalid library constant
2026-08-07 11:13:34 -04:00
Brad King
ebe735cc3c Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2026-08-07 (1c806117)
2026-08-07 11:13:34 -04:00
Arha Gatram
86759dce81 enable_language: add support for usage in subdirectories
Propagates variables set in enable_language() logic up variable scopes
so that the language can be used by targets in the ancestor directories.
Works through block() and function() scopes as well. The
add_subdirectory() call can be thought of as the effective call site for
enabling the language. The same holds for endblock() and the actual
function call.

Adds a policy CMP0220 to control this behavior. As the language is
"enabled" at each ancestor scope, the policy is checked. If OLD, the
language is not enabled at this scope and the ones above.

Closes: #27881 #27508 #27389
Related: #26751 #27564
2026-08-07 11:05:57 -04:00
Tom Osika
4f09a029dc cmake_print_variables: Deprecate in favor of cmake_language(PRINT_VARIABLES)
Re-implement it in terms of the replacement command.

Issue: #27513
2026-08-07 10:57:01 -04:00
Brad King
1d4c097f70 Merge branch 'release-4.4' 2026-08-07 10:54:55 -04:00
Brad King
85bddc5f11 Merge branch 'release-4.3' 2026-08-07 10:54:49 -04:00
Brad King
d930dd927f Merge branch 'release-4.2' 2026-08-07 10:54:39 -04:00
Brad King
47875d249f Merge branch 'release-4.1' 2026-08-07 10:54:34 -04:00
Brad King
62dc29dfcc Merge branch 'release-4.0' 2026-08-07 10:54:27 -04:00
Brad King
ce8b1f0e29 Merge branch 'release-3.31' 2026-08-07 10:54:21 -04:00
Brad King
d657ecc4ea Merge branch 'release-4.3' into release-4.4 2026-08-07 10:54:12 -04:00
Brad King
b91c6682b9 Merge branch 'release-4.4' 2026-08-07 10:53:34 -04:00
Brad King
0dfba78434 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting'
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12378
2026-08-07 10:53:33 -04:00
Brad King
7ecf782279 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.4
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12378
2026-08-07 10:53:31 -04:00
Brad King
13b58e541e Merge branch 'release-4.2' into release-4.3 2026-08-07 10:52:41 -04:00
Brad King
d17ff27167 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.3
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:52:29 -04:00
Brad King
0d9389f17c Merge branch 'release-4.1' into release-4.2 2026-08-07 10:52:24 -04:00
Brad King
0e22b819e2 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.2
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:52:09 -04:00
Brad King
69c0c40459 Merge branch 'release-4.0' into release-4.1 2026-08-07 10:51:56 -04:00
Brad King
4ad6fe8c84 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.1
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:51:40 -04:00
Brad King
1d4e75b58a Merge branch 'release-3.31' into release-4.0 2026-08-07 10:51:33 -04:00
Brad King
30b4c66234 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.0
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:51:25 -04:00
Brad King
2ec6c94f82 Merge topic 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting' into release-3.31
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:48:42 -04:00
Brad King
e2a05ee03c Merge topic 'fileapi-reply-case-collision'
e6482b840a fileapi: Fix dangling reply reference on case-insensitive filesystems

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12379
2026-08-07 10:48:15 -04:00
Brad King
b547a934f4 Merge topic 'FindPython-CROSSCOMPILING_EMULATOR-management'
8c0bb8ee95 FindPython: Add support for python specific crosscompiling emulator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12380
2026-08-07 10:45:03 -04:00
Brad King
a42ed06cd0 Merge topic 'fix-27980-2'
ba93b9cf49 borland: support long comments for custom commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12374
2026-08-07 10:39:21 -04:00
Brad King
5ae6ad5ad2 Merge topic 'ci-intel-compiler'
891f7f8cd5 ci: add job testing Intel oneAPI 2026.1.0 compilers on Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12376
2026-08-07 10:37:26 -04:00
Brad King
0e883c5753 MSYS Makefiles: Drop outdated enforcement of archiver availability
Since this generator was added, it enforced availability of `CMAKE_AR`
during `enable_language`.  These days, the ABI detection and/or check
for a working compiler have already been run via `try_compile`, so if
the archiver is required but missing we will have already failed.  Drop
the early generator-specific enforcement that `CMAKE_AR` has been found.
It's needed only if the project actually creates an archive.
2026-08-07 08:24:22 -04:00
Kitware Robot
85e06e3791 CMake Nightly Date Stamp 2026-08-07 00:05:10 -04:00
Marc Chevrier
8c0bb8ee95 FindPython: Add support for python specific crosscompiling emulator
Fixes: #27996
2026-08-06 17:57:26 +02:00
Daksh Mamodiya
e6482b840a fileapi: Fix dangling reply reference on case-insensitive filesystems
Reply file names embed the configuration name verbatim.  Reconfiguring
a build tree with a build type that differs from the previous one only
in case (e.g. Debug -> debug) makes CMake write a reply whose name also
differs only in case from the existing file.  On a case-insensitive
filesystem the write is skipped because the name already exists, but
RemoveOldReplyFiles compared on-disk names to the just-written names
textually and deleted the surviving file, leaving the reply index
citing a target or directory reply that no longer exists on disk.

Prune reply files by file identity via cmSystemTools::GetFileId instead
of by name, so an on-disk entry that aliases a reply we just wrote is
kept.  An entry whose identity cannot be obtained is retained rather
than deleted.

Fixes: #28022
2026-08-06 17:44:54 +02:00
Arha Gatram
220fc8622d block: Fix incorrect policy scope creation order
Creates the policy scope after the variable scope instead of the other
way round. This ensures that the cmStateSnapshot which the policy is
registered to is the same as the one created with the variable scope so
that reading a policy from the parent snapshot does not incorrectly read
policies from the new snapshot.
2026-08-06 10:49:22 -04:00
Brad King
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting' 2026-08-06 10:47:43 -04:00
Brad King
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
Otherwise a malicious file name can inject code into the verification
script.

Fixes: #28023
2026-08-06 10:38:49 -04:00