9749 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
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
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
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
Marc Chevrier
8c0bb8ee95 FindPython: Add support for python specific crosscompiling emulator
Fixes: #27996
2026-08-06 17:57:26 +02:00
Tom Osika
a06658b6d7 cmake_language: Add PRINT_VARIABLES operation
Print CMake variables in human-readable form for debugging.

Issue: #27513
2026-08-05 14:45:44 -04:00
Daksh Mamodiya
0862819756 bash-completion: Fix spurious 'following' target completion candidate
The '--target' completion parsed 'cmake --build --target help'
with a sed pattern whose leading '...' matched any three
characters, so the header line yielded a bogus 'following'
candidate.  Anchor the pattern to literal dots.

Also note in the user-interaction guide that 'make' target
tab-completion is provided by the external bash-completion
package, which may hide the plain '<target>' name when a
'<target>/fast' variant exists, and recommend
'cmake --build --target' completion instead.

Fixes: #27873
2026-08-05 05:51:19 +02:00
Brad King
fc5ff503cf Merge topic 'ctest-json-test-prop-raw'
572e4b5d2a ctest: Add --show-only=json-v1-raw option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12288
2026-08-04 10:53:33 -04:00
Arha Gatram
572e4b5d2a ctest: Add --show-only=json-v1-raw option
This option changes the JSON value field for test properties to use the
unparsed string value.

Fixes: #27958
2026-08-03 09:36:11 -07:00
Vito Gamberini
ab1bd6f6c6 c++modules: Remove CXX_MODULE_STD and CMAKE_CXX_COMPILER_IMPORT_STD
Fixes: #27966, #27992, #28000
2026-08-03 10:05:34 -04:00
Brad King
e98e59cc82 Merge topic 'FindPython-SOSABI_PLATFORM'
91e227939c FindPython: Add Python_SOSABI_PLATFORM variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12360
2026-08-01 07:27:55 -04:00
Marc Chevrier
91e227939c FindPython: Add Python_SOSABI_PLATFORM variable
This variable gives the SABI module extension which include the
platform triplet.

Fixes: #27997
2026-07-31 16:41:01 +02:00
Brad King
8e7b683c67 Merge branch 'release-4.4' 2026-07-31 09:30:03 -04:00
Brad King
c162d6852d CMake 4.4.2 2026-07-31 09:01:06 -04:00
Brad King
6563ddeea3 Merge topic 'better-tty-preset-macro-refs'
c00106b20f Help: Improve formatting of presets manual

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12340
2026-07-30 11:36:00 -04:00
Brad King
8a947d73d5 Merge topic 'warn-non-target-directives'
00959286b9 Diagnostics: Warn about non-target directives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12172
2026-07-29 10:34:27 -04:00
Matthew Woehlke
c00106b20f Help: Improve formatting of presets manual
Tweak how we reference preset macros so that references also carry
'literal' markup. While this provides a modest improvement to HTML
rendered help, it primarily serves to apply 'literal' formatting
consistently for TTY output (`cmake --help-presets`).
2026-07-28 17:01:59 -04:00
Matthew Woehlke
00959286b9 Diagnostics: Warn about non-target directives
Introduce `CMD_STRICT` to act as a parent for warnings about allowed but
disrecommended usage. Introduce a warning that discourages use of
non-target directives (which modify the build environment for the entire
[sub]tree). Add notes to the official documentation recommending use of
target-specific alternatives. This has been accepted wisdom for quite
some time, but only some of the affected commands made any mention of
this in the documentation.
2026-07-28 11:38:20 -04:00
Brad King
b5efecc945 Merge branch 'release-4.4' 2026-07-28 10:59:30 -04:00
Brad King
d1cffecacd CMake 4.4.1 2026-07-28 10:26:50 -04:00
Brad King
4b88240b64 Merge topic 'ctest_test-label-and'
257865e1d4 CTest: Make ctest_test() label filters multi-value (AND)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12321
2026-07-28 09:50:30 -04:00
Brad King
e7b32d14b9 Merge topic 'doc-FILE_SET-buildsystem'
c707fde0f2 Help: Move general FILE_SET info to cmake-buildsystem(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12309
2026-07-28 09:46:09 -04:00
Brad King
1de00b708e Merge topic 'add_custom_command-comment-doc-clarify'
9d9733a7f5 Help: Clarify add_custom_command COMMENT display timing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12334
2026-07-28 09:44:37 -04:00
Brad King
70f568b17b Merge topic 'FindPython-add-pydebug-ABI-support-on-Windows'
84cb7e2629 FindPython: Add support for pydebug ABI flag on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12325
2026-07-28 09:35:25 -04:00
Brad King
32d437aa49 Merge topic 'FindPython-add-pydebug-ABI-support-on-Windows' into release-4.4
84cb7e2629 FindPython: Add support for pydebug ABI flag on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12325
2026-07-28 09:35:23 -04:00
Daksh Mamodiya
9d9733a7f5 Help: Clarify add_custom_command COMMENT display timing
The "before the commands are executed" wording predated the Ninja
generator; the native build tool controls when and how it is shown.

Fixes: #27991
2026-07-27 17:42:22 +02:00
Brad King
07368fab0c Merge topic 'test-include-files-genex'
63316be823 TEST_INCLUDE_FILES: Evaluate generator expressions in include paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12313
2026-07-27 10:12:30 -04:00
Brad King
92fbd6d0e0 Merge topic 'reduce-utf-8'
96b3a4e6c7 Style: Replace some UTF-8 characters with ASCII equivalents

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12319
2026-07-27 09:56:23 -04:00
Tyler Yankee
c707fde0f2 Help: Move general FILE_SET info to cmake-buildsystem(7)
File sets have evolved to be more ubiquitous throughout a CMake build,
outside the scope of simply the target_sources command. Move general
information to the `cmake-buildsystem(7)` manual and keep only
reference information specific to the syntax of target_sources in its
command page. Sprinkle some more cross-references to the new location.

Fixes: #27900

Suggested-By: Marc Chevrier <marc.chevrier@gmail.com>
2026-07-27 09:01:37 -04:00
Marc Chevrier
84cb7e2629 FindPython: Add support for pydebug ABI flag on Windows
Fixes: #27969
2026-07-26 17:10:25 +02:00
Daksh Mamodiya
257865e1d4 CTest: Make ctest_test() label filters multi-value (AND)
The ctest(1) command line allows repeating -L/-LE to form an AND
filter over test labels, but the ctest_test() and ctest_memcheck()
scripting commands accepted only a single INCLUDE_LABEL/EXCLUDE_LABEL
value, so a dashboard script could not express that filter.

The label-matching engine already stores the include/exclude
expressions as vectors and applies them with AND semantics; only the
command binding was single-value.  Change both keywords to multi-value
(NonEmpty<vector<string>>) and hand the collected list straight to the
engine.  ctest_memcheck() gains the same behavior for free, since it
inherits the option set.

Fixes : #27497
2026-07-24 21:27:58 +02:00
Brad King
96b3a4e6c7 Style: Replace some UTF-8 characters with ASCII equivalents 2026-07-24 09:55:14 -04:00
Daksh Mamodiya
63316be823 TEST_INCLUDE_FILES: Evaluate generator expressions in include paths
The TEST_INCLUDE_FILE(S) directory properties were written verbatim into
CTestTestfile.cmake, so a $<CONFIG>-parameterized include path could not
select a per-configuration script and failed at ctest time.

Evaluate generator expressions per include entry in
cmLocalGenerator::GenerateTestFiles():

* Entries without a generator expression are emitted unchanged.
* On single-config generators a genex entry is evaluated once and
  emitted as one unconditional include.
* On multi-config generators it is evaluated for every configuration;
  a config-independent result collapses to one unconditional include,
  otherwise each non-empty per-config result is guarded by a
  CTEST_CONFIGURATION_TYPE branch, mirroring add_test().  An entry that
  evaluates to empty adds no include.

Promote cmScriptGenerator::CreateConfigTest to a public static helper so
the include guards reuse the exact add_test() config-test encoding; the
instance overloads now delegate to it.  Evaluated results are quoted via
cmScriptGenerator::Quote, while plain entries keep their raw
serialization.

Fixes: #27941
2026-07-23 18:58:04 +02:00
Brad King
42da7a30a9 Merge topic 'ctest-dyn-rsrc-spec-rel-path'
4c2d06e69b CTest: Add support for relative paths in GENERATED_RESOURCE_SPEC_FILE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12265
2026-07-23 08:56:22 -04:00
Brad King
f3fd32b96d Merge topic 'doc-cmake_language-print'
a09578ae84 Help/cmake_language: Fix PRINT_TARGETS signature rendering
f46a631f0c Help/cmake_language: Document print operation(s) last

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12311
2026-07-23 08:35:07 -04:00
Brad King
7eb1890244 Merge topic 'cps-executable-import'
207c132378 CPS: Support importing executables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12294
2026-07-23 08:32:38 -04:00
Tom Osika
a09578ae84 Help/cmake_language: Fix PRINT_TARGETS signature rendering 2026-07-22 14:39:00 -04:00
Tom Osika
f46a631f0c Help/cmake_language: Document print operation(s) last
Move documentation added by commit 45623dd5f6 (cmake_language: Add
PRINT_TARGETS operation, 2026-06-26) to the end of the signature list
to make room for more print signatures.

Issue: #27513
2026-07-22 14:38:41 -04:00
Arha Gatram
4c2d06e69b CTest: Add support for relative paths in GENERATED_RESOURCE_SPEC_FILE 2026-07-22 09:49:28 -07:00
Brad King
9c631586d2 Merge topic 'cuda-toolkit-namespace'
f2d5320d42 FindCUDAToolkit: Add CUDAToolkit:: namespace targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12290
2026-07-22 11:32:13 -04:00
Brad King
fcd200ab3b Merge topic 'diagnose-deprecated-commands'
75161b34b6 bootstrap: Remove deprecated commands
664eb8412a cmake: Don't use deprecated commands to build
3745af331a Add deprecation diagnostics to deprecated commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12277
2026-07-22 11:27:01 -04:00
Brad King
5868009096 Merge topic 'ctest-windows-jobserver-client'
79331d5865 CTest: Add Windows job server client

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12297
2026-07-22 11:23:38 -04:00
Vito Gamberini
207c132378 CPS: Support importing executables
Fixes: #27964
2026-07-22 10:45:59 -04:00
Brad King
697df9a12a Merge topic 'vs-clangcl-modules'
027b962a81 VS: Avoid unsupported ScanSourceForModuleDependencies under ClangCl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Vito Gamberini <vito.gamberini@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !12301
2026-07-22 09:55:45 -04:00
Brad King
8dd7eb41bb Merge topic 'vs-clangcl-modules' into release-4.4
027b962a81 VS: Avoid unsupported ScanSourceForModuleDependencies under ClangCl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Vito Gamberini <vito.gamberini@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !12301
2026-07-22 09:55:42 -04:00
Brad King
4212dce181 Merge topic 'doc-ide-compiler-selection'
90e2a33dba Help/CMAKE_LANG_COMPILER: Document Visual Studio, Xcode, GHS generators quirks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12296
2026-07-22 09:52:31 -04:00
Brad King
5175aa4872 Merge topic 'doc-ide-compiler-selection' into release-4.4
90e2a33dba Help/CMAKE_LANG_COMPILER: Document Visual Studio, Xcode, GHS generators quirks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12296
2026-07-22 09:52:29 -04:00
leha-bot
90e2a33dba Help/CMAKE_LANG_COMPILER: Document Visual Studio, Xcode, GHS generators quirks
They don't support setting compiler via this variable, they use the
toolsets, so you could switch the compiler by choosing another toolset.

Closes: #21644
2026-07-21 17:39:07 -04:00