Commit Graph

12936 Commits

Author SHA1 Message Date
Brad King c8527dc4d8 Merge topic 'fileapi-relative-under-root'
41be8cb44a FileAPI: Fix paths relative to root directory
3f7f2368d6 Avoid extra / in path to CMakeLists.txt in root directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11314
2025-10-23 11:19:43 -04:00
Brad King 162b1d5910 Merge topic 'fbuild_disable_cuda_support'
7953214454 FASTBuild: Explicitly disallow CUDA language since it is not implemented

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11334
2025-10-23 11:17:55 -04:00
Eduard Voronkin 7953214454 FASTBuild: Explicitly disallow CUDA language since it is not implemented
Issue: #27318
2025-10-22 10:28:40 -04:00
Richard 41be8cb44a FileAPI: Fix paths relative to root directory
We normalize directory paths to not end in `/`.  However, a root
directory path always ends in `/`.  Avoid removing the first character
after it.

Fixes: #27308
2025-10-22 09:25:39 -04:00
Brad King 9801855b63 Merge topic 'gtest-json-discovery-empty'
f67efb64ab GoogleTest: Restore support for empty discovered test list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11326
2025-10-22 07:29:14 -04:00
Brad King e00b84ec13 Merge topic 'gtest-json-discovery-empty' into release-4.2
f67efb64ab GoogleTest: Restore support for empty discovered test list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11326
2025-10-22 07:29:11 -04:00
Brad King 57c4fafcf5 Merge topic 'fix-cmake_determine_linker_id-error-handling'
69e2f3f8ea Linker: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL set to ANY
576e63f28d Compilers: Use -print-sysroot output only with successful exit code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11313
2025-10-22 07:25:38 -04:00
Brad King 32485cd7e2 Merge topic 'fix-cmake_determine_linker_id-error-handling' into release-4.2
69e2f3f8ea Linker: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL set to ANY
576e63f28d Compilers: Use -print-sysroot output only with successful exit code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11313
2025-10-22 07:25:35 -04:00
Ottmar Zittlau f67efb64ab GoogleTest: Restore support for empty discovered test list
Since commit 1cdceae8e3 (GoogleTest: Parse discovered test list from
JSON output if supported, 2025-05-02, v4.2.0-rc1~533^2~2) we've
incorrectly tried to `return()` from a `macro()` when no tests are
available.  This led to the situation that a file that contains the test
details was not properly overwritten but still indicated that the test
target was not built.

Fixes: #27319
2025-10-21 11:39:19 -04:00
Brad King 27d7542d72 Merge topic 'fix-tests-regex-3'
5de7a09e77 Tests/RunCMake: Match dots more precisely, part 3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11321
2025-10-21 11:27:33 -04:00
Brad King 3f3f52082e Merge topic 'fix-tests-regex-3' into release-4.2
5de7a09e77 Tests/RunCMake: Match dots more precisely, part 3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11321
2025-10-21 11:27:30 -04:00
Brad King 6ec4d40887 Merge topic 'fix-typos'
60273a364c Tests/RunCMake: fix version typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11325
2025-10-21 11:21:45 -04:00
Brad King c1565ed4e5 Merge topic 'fix-typos' into release-4.2
60273a364c Tests/RunCMake: fix version typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11325
2025-10-21 11:21:42 -04:00
Brad King 90e57c6eb0 Merge topic 'test-cleanup'
e0ee6556a8 Tests: Remove outdated CMake.PolicyCheck test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11330
2025-10-21 11:19:02 -04:00
AJIOB 5de7a09e77 Tests/RunCMake: Match dots more precisely, part 3 2025-10-20 14:45:24 -04:00
Brad King e0ee6556a8 Tests: Remove outdated CMake.PolicyCheck test
Since commit dade821948 (cmPolicies: Reduce boilerplate in policy table
entries, 2024-11-13, v4.0.0-rc1~481^2~3), or perhaps earlier formatting
changes, the `grep` performed by this test is non-functional.
2025-10-20 13:55:21 -04:00
Brad King 23eb60f7ee Merge topic 'pch-reuse-from-without-pch-warning'
cb6423703a PrecompileHeaders: downgrade `REUSE_FROM` without a PCH to a warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11318
2025-10-20 13:47:50 -04:00
Brad King f0422c006c Merge topic 'pch-reuse-from-without-pch-warning' into release-4.2
cb6423703a PrecompileHeaders: downgrade `REUSE_FROM` without a PCH to a warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11318
2025-10-20 13:47:48 -04:00
Brad King 1538875ba3 Merge topic 'collect-genex-fix'
6e637b1102 install(PACKAGE_INFO): Fix error when usage requirements contain certain genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11322
2025-10-20 13:42:53 -04:00
Brad King 2813b08d69 Merge topic 'collect-genex-fix' into release-4.2
6e637b1102 install(PACKAGE_INFO): Fix error when usage requirements contain certain genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11322
2025-10-20 13:42:49 -04:00
Tristan Daifuku 69e2f3f8ea Linker: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL set to ANY
Tolerate expected failures of linkers invoked via `execute_process`.
2025-10-20 11:58:46 -04:00
AJIOB 60273a364c Tests/RunCMake: fix version typo 2025-10-19 07:55:13 +03:00
Ben Boeckel cb6423703a PrecompileHeaders: downgrade REUSE_FROM without a PCH to a warning
Prior to f9bc615d (pchreuse: ban PCH reuse from targets which disable
PCH, 2025-06-15), using a target without PCH as a `REUSE_FROM` target
was not an error. Some projects had been doing this unknowingly.
Downgrade the fatal error into a warning so that such projects can at
least continue to build.

Fixes: #27316
2025-10-17 12:00:40 -04:00
Martin Duffy 6e637b1102 install(PACKAGE_INFO): Fix error when usage requirements contain certain genex
Since commit 13c7bb5b0c (cmGeneratorExpression: Update strip function to
collect parsed expressions, 2025-04-08, v4.1.0-rc1~361^2~1), the logic
to strip generator expressions would error if the stripped expressions
were being collected and an expression without a `:` was found inside an
expression with a `:`. This resulted in an error when exporting a target
that contained such a generator expression in its link libraries or
compile definitions.

Address the error by checking whether the latest `$<` proceeded the
latest `:`.
2025-10-17 11:34:43 -04:00
Brad King 1453f20ea1 Merge topic 'fix-tests-regex'
62b112ee25 Tests/RunCMake: Match CMakeLists.txt file name more precisely
06ccd15457 Tests/RunCMake: Match xxx.cmake file name more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11317
2025-10-17 10:09:13 -04:00
AJIOB 62b112ee25 Tests/RunCMake: Match CMakeLists.txt file name more precisely 2025-10-16 17:42:12 +03:00
AJIOB 06ccd15457 Tests/RunCMake: Match xxx.cmake file name more precisely 2025-10-16 17:42:12 +03:00
Brad King 91941fb20f Merge topic 'fix_regex_in_tests'
638cf8f194 Tests/RunCMake: Match CMakeLists.txt file name more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11312
2025-10-16 09:07:27 -04:00
Hanna Rusakovich 638cf8f194 Tests/RunCMake: Match CMakeLists.txt file name more precisely 2025-10-15 09:39:01 -04:00
Brad King afa9e9d570 Merge topic 'usejava-modjar-improvements'
343ee5b9ee UseJava: add INCLUDE_MODULES argument to add_jar
b3365e7c57 UseJava: extract function to prepare the classpath arguments in add_jar

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11280
2025-10-15 09:12:24 -04:00
Taylor Sasser b209c41dfa export(TARGETS): Restore EXPORT_LINK_INTERFACE_LIBRARIES
Refactoring in commit 998495cb49 (cmExportCommand: Port to
cmSubcommandTable, 2025-07-15) accidentally removed support for the
`EXPORT_LINK_INTERFACE_LIBRARIES` argument.  Restore it with a test.

Fixes: #27302
2025-10-14 13:03:22 -04:00
Javier Martín 343ee5b9ee UseJava: add INCLUDE_MODULES argument to add_jar
Arguments are added to the dependencies list, and to the "--module-path"
passed to javac, which is only generated for adequate JDK versions.
2025-10-14 18:23:21 +02:00
Brad King 5e7fa8d624 Merge topic 'patch-FindLua-version-51'
b4a08078d6 FindLua51: Use Lua51_VERSION result variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11306
2025-10-14 11:46:27 -04:00
Brad King 6843f4b62a Merge topic 'patch-FindLua-version-51' into release-4.2
b4a08078d6 FindLua51: Use Lua51_VERSION result variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11306
2025-10-14 11:46:25 -04:00
Brad King 623e1b6c62 Merge topic 'external-project-env-mod-lists'
9cb590b843 ExternalProject: Fix lists and empty commands with environment modification
2e0a8455b3 Tests: Match expected environment modification more completely
819c6177b8 Tests: Match expected environment modification more consistently
c555e10fd4 Tests: Use shorter paths in RunCMake.ExternalProject

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11272
2025-10-14 11:40:40 -04:00
Brad King 6b57a8435f Merge topic 'external-project-env-mod-lists' into release-4.2
9cb590b843 ExternalProject: Fix lists and empty commands with environment modification
2e0a8455b3 Tests: Match expected environment modification more completely
819c6177b8 Tests: Match expected environment modification more consistently
c555e10fd4 Tests: Use shorter paths in RunCMake.ExternalProject

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11272
2025-10-14 11:40:33 -04:00
Peter Kokot b4a08078d6 FindLua51: Use Lua51_VERSION result variable
If using both FindLua and FindLua51 modules, the FindLua51 and Lua 5.2
or newer is found, FindLua51 module can set the Lua_VERSION variable to
empty value. Instead, the Lua51_VERSION can be used to bypass this
issue.

Issue: #27088
2025-10-13 12:10:24 -04:00
Evan Wilde 9cb590b843 ExternalProject: Fix lists and empty commands with environment modification
Fix two bugs from commit e301cbffcc (ExternalProject: Set environment
variables, 2025-04-09):

* Do not flatten lists in command arguments when adding env mods.

* Remove empty `COMMAND`s without injecting corresponding env mods.

Fixes: #27125
Fixes: #27126
Co-authored-by: Brad King <brad.king@kitware.com>
2025-10-13 10:28:17 -04:00
Brad King 948b2fe31a CMP0204: Remove redundant cases from RunCMake.MsvcCharsetDefines
A single executable for each policy/charset combination is sufficient.
The behavior is the same across target types.

The "OLD" cases are not needed because "WARN" has the same behavior.

The `-D` cases are not needed because `target_compile_definitions`
strips the `-D` prefix before populating `COMPILE_DEFINITIONS`.
2025-10-12 11:11:41 -04:00
Brad King 2e0a8455b3 Tests: Match expected environment modification more completely 2025-10-12 10:33:52 -04:00
Brad King 819c6177b8 Tests: Match expected environment modification more consistently
Revert the regex change from commit 01147454e7 (FASTBuild: Add
generator, 2025-07-30) and revise the build output to match anyway.
The actual problem was that build and install steps are driven through
a nested `cmake --build`, and `fbuild` prefixes the first line of build
output.  Add an innocuous first line so we can match the intended lines
consistently across generators.
2025-10-12 10:33:14 -04:00
Brad King 8a135ea018 Tests: Teach MSVC ABI defs cases to tolerate NVCC CUDA arch warnings 2025-10-10 10:38:34 -04:00
Brad King c555e10fd4 Tests: Use shorter paths in RunCMake.ExternalProject 2025-10-10 09:49:40 -04:00
Brad King 597e421ba3 Help: Remove incorrect Windows env var limitation from CTEST_PARALLEL_LEVEL
In commit 5de1e21659 (ctest: Allow passing -j without value to choose a
contextual default, 2024-03-06, v3.29.0-rc4~10^2) I misdiagnosed the
reason that the test could not set an empty environment variable on
Windows.  It is actually a limitation of `set(ENV{VAR})` inherited from
its implementation using `_wputenv`.  Process environment blocks can
contain empty environment variables.

Issue: #27285
2025-10-09 09:46:01 -04:00
Martin Duffy f195c9ef2a genex: Add TARGET_INTERMEDIATE_DIR expression
Fixes: #27196
2025-10-09 08:07:20 -04:00
Brad King 81ee78a7e9 Merge topic 'update-kwsys'
77ea15b797 Tests: Add case covering `cmake -E env` with empty environment variable
209dfc51d3 Merge branch 'upstream-KWSys' into update-kwsys
92a7104600 KWSys 2025-10-08 (3bae03fe)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11288
2025-10-08 11:25:25 -04:00
Brad King 04c6c8fc09 Merge topic 'set-ENV-empty'
aa5711490f set: Explicitly unset empty environment variables on Windows
723a83d8cd set: Factor out helper to set environment variables
20761cf349 set: Add test cases for setting ENV{VAR} to empty
a878d1c490 Tests: Unset the PATH environment variable more explicitly where needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11290
2025-10-08 11:20:36 -04:00
Brad King 77ea15b797 Tests: Add case covering cmake -E env with empty environment variable
Issue: #27285
2025-10-08 11:17:20 -04:00
Brad King 20761cf349 set: Add test cases for setting ENV{VAR} to empty
The behavior differs by platform and if the variable is already set.
Encode existing behavior in tests to preserve it until intentionally
changed.

Issue: #27285
2025-10-07 11:32:53 -04:00
Brad King a878d1c490 Tests: Unset the PATH environment variable more explicitly where needed
Previously we relied on setting an environment variable to empty to
unset it on Windows.
2025-10-07 11:32:48 -04:00