1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Commit Graph

72401 Commits

Author SHA1 Message Date
Brad King
209dfc51d3 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-10-08 (3bae03fe)
2025-10-08 11:17:13 -04:00
KWSys Upstream
92a7104600 KWSys 2025-10-08 (3bae03fe)
Code extracted from:

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

at commit 3bae03fe5e4267117b7837eb8f1b498bea3b3c12 (master).

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

Brad King (5):
      6b282151 SystemTools: Clarify UnPutEnv implementation comment with GNU runtime
      99d779f3 SystemTools: Simplify UnPutEnv implementation with MSVC
      523f9256 SystemTools: Implement HasEnv via GetEnvironmentVariableW on Windows
      a446aa49 SystemTools: Improve PutEnv for empty values on Windows
      0a58a55e SystemTools: Reduce allocation in GetEnv on Windows

Peter Kokot (1):
      45bb9a19 CMake: Remove unused CheckTypeSize module
2025-10-08 11:17:12 -04:00
Brad King
aa5711490f set: Explicitly unset empty environment variables on Windows
KWSys's SystemTools::PutEnv implementation, on Windows, has long
interpreted `A=` as unset.  This differs from the behavior on other
platforms.  Code the distinction explicitly in `set(ENV{VAR})`.

Issue: #27285
2025-10-07 11:33:03 -04:00
Brad King
723a83d8cd set: Factor out helper to set environment variables 2025-10-07 11:32:56 -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
Brad King
0181fb4cc5 Merge topic 'define-msvc-charset'
b554dead95 Tests: Cover CMP0203 and CMP0204 on all platforms
6874efb592 MSVC: Always define a character set
2cae68ecbe Source: Minor optimizations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11269
2025-10-07 10:43:08 -04:00
Alex Overchenko
b554dead95 Tests: Cover CMP0203 and CMP0204 on all platforms 2025-10-07 09:29:42 -04:00
AJIOB
6874efb592 MSVC: Always define a character set
When targeting the MSVC ABI, define `_MBCS` by default if the project
does not define `_SBCS` or `_UNICODE`.  Visual Studio has long defined
one of the three character set macros automatically.  For consistency,
define it when compiling for the MSVC ABI with other generators.
Add policy CMP0204 for compatibility.

Fixes: #27275
2025-10-07 09:29:32 -04:00
AJIOB
2cae68ecbe Source: Minor optimizations 2025-10-07 09:29:18 -04:00
Brad King
927ccf212f Merge topic 'help-TRYRUN_OUTPUT_STDOUT'
6d61783103 Help: Document try_run output cache entries for cross-build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11284
2025-10-07 09:02:32 -04:00
Brad King
bd0351c73d Merge branch 'release-4.1' 2025-10-07 08:58:53 -04:00
Brad King
0af6751e68 Merge topic 'ninja-trailing-newline-comment'
12a225d56d Ninja: handle trailing newlines in variable stanzas

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11286
2025-10-07 08:58:52 -04:00
Brad King
58880d6773 Merge topic 'ninja-trailing-newline-comment' into release-4.1
12a225d56d Ninja: handle trailing newlines in variable stanzas

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11286
2025-10-07 08:58:51 -04:00
Brad King
2ee36e00df Merge topic 'ci-gcov'
fa9a556c7f ci: Drop unnecessary hard-coding of C++11 in gcov jobs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !11287
2025-10-07 08:57:38 -04:00
Kitware Robot
53716f6bfd CMake Nightly Date Stamp 2025-10-07 00:04:46 -04:00
Brad King
9126ed5162 Merge topic 'fix_dev_docs_typo'
2b5fcf1d07 Help/dev: Fix typo in Source Code Guide

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11282
2025-10-06 10:40:08 -04:00
Jinzhe Zeng
6d61783103 Help: Document try_run output cache entries for cross-build
Document `try_run` cache entries added by commit a2cd0687db (try_run:
Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE.,
2022-07-08, v3.25.0-rc1~443^2):

* `<runResultVar>__TRYRUN_OUTPUT_STDOUT`
* `<runResultVar>__TRYRUN_OUTPUT_STDERR`

Fixes: #27281
2025-10-06 10:33:54 -04:00
Alex Overchenko
2b5fcf1d07 Help/dev: Fix typo in Source Code Guide 2025-10-06 10:20:03 -04:00
Brad King
fa9a556c7f ci: Drop unnecessary hard-coding of C++11 in gcov jobs
In commit f7b0ddbe92 (gitlab-ci: add a series of jobs to perform
coverage, 2025-09-24) we accidentally copied the C++11 specification
from the `fedora42-ninja` jobs.  Drop it.
2025-10-06 10:03:14 -04:00
Ben Boeckel
12a225d56d Ninja: handle trailing newlines in variable stanzas
When a variable ends with a newline, the Ninja generator escapes it as
expected with `$\n`. However, when writing it out, whitespace is
trimmed. This leaves a trailing `$` instead which consumes the newline
and masks the following stanza. In a custom command, this hides the
`restat = 1` setting.

Detect this case and restore the newline as necessary.

See: #25983
2025-10-06 09:54:15 -04:00
Brad King
55c6b79da6 Merge topic 'tutorial-fix-typos'
c8adfdb0a8 Tutorial: Fix typos and mislabeled code blocks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11281
2025-10-06 09:10:37 -04:00
Brad King
4ac0912c24 Merge topic 'ci-bullseye'
8f166fa51e ci: Add jobs to perform coverage with BullseyeCoverage on Linux
cb3d917289 ci: Add script to install BullseyeCoverage in Linux jobs
2548b6e24d ci: add pre-test step
8d0ecda821 ci: add pre-build step after configure but before build
206b831973 ci: rename pre-build step to pre-configure since that is when it runs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !11283
2025-10-06 08:44:36 -04:00
Kitware Robot
f2afbff2c4 CMake Nightly Date Stamp 2025-10-06 00:04:37 -04:00
Brad King
8f166fa51e ci: Add jobs to perform coverage with BullseyeCoverage on Linux 2025-10-05 07:04:03 -04:00
Brad King
cb3d917289 ci: Add script to install BullseyeCoverage in Linux jobs 2025-10-05 07:03:49 -04:00
Kitware Robot
d212c84bf9 CMake Nightly Date Stamp 2025-10-05 00:04:42 -04:00
Kitware Robot
73fa6ab3e6 CMake Nightly Date Stamp 2025-10-04 00:04:52 -04:00
Brad King
2548b6e24d ci: add pre-test step 2025-10-03 18:33:39 -04:00
Brad King
8d0ecda821 ci: add pre-build step after configure but before build 2025-10-03 18:17:15 -04:00
Brad King
206b831973 ci: rename pre-build step to pre-configure since that is when it runs 2025-10-03 18:17:14 -04:00
Vito Gamberini
c8adfdb0a8 Tutorial: Fix typos and mislabeled code blocks 2025-10-03 18:01:06 -04:00
Brad King
0d01bc72b8 Merge topic 'cps-symbolic-info'
62a1d3e7f1 FileAPI: Add symbolic property to targets
d92b6c3e20 CPS: Add Symbolic Components
03284e018f Help: Simplify file-api version information for "abstract" field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11132
2025-10-03 11:24:50 -04:00
Brad King
caf01b88bc Merge topic 'instrumentation-target-content'
97adbc91fa instrumentation: Move target data into content files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11251
2025-10-03 11:21:17 -04:00
Brad King
c6709dbf94 Merge topic 'patch-FindCxxTest-found-variable'
fdadbe42fe FindCxxTest: Add CxxTest_FOUND variable and update docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11278
2025-10-03 11:19:52 -04:00
Brad King
75c9a28459 Merge topic 'tutorial-fileset-fix'
07518509db Tutorial: Fix example FILE_SET names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11279
2025-10-03 11:18:39 -04:00
Brad King
bb8b1c7ecf Merge branch 'release-4.1' 2025-10-03 11:14:16 -04:00
Brad King
c878321a40 Merge branch 'release-4.0' 2025-10-03 11:14:11 -04:00
Brad King
a2f4f74ed3 Merge branch 'release-4.0' into release-4.1 2025-10-03 11:13:58 -04:00
Brad King
8f4e795879 Merge branch 'release-4.1' 2025-10-03 11:12:08 -04:00
Brad King
e9beb26909 Merge topic 'pkg-root-var'
1a16e4fc69 Merge branch 'backport-pkg-root-var' into pkg-root-var
87a661a916 find_package: Fix regression on `<PackageName>_ROOT` relative to CWD
fc059e1978 Merge branch 'backport-pkg-root-var' into pkg-root-var
ab0a44a0a0 find_package: Fix regression on `<PackageName>_ROOT` relative to CWD
d029b828b2 find_package: Avoid repeating search for lower-case .cps file
fc4d238d7a Tests: Match RunCMake.find_package-CPS version candidates more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11277
2025-10-03 11:12:07 -04:00
Brad King
9cd9d787ea Merge topic 'pkg-root-var' into release-4.1
1a16e4fc69 Merge branch 'backport-pkg-root-var' into pkg-root-var
87a661a916 find_package: Fix regression on `<PackageName>_ROOT` relative to CWD
fc059e1978 Merge branch 'backport-pkg-root-var' into pkg-root-var
ab0a44a0a0 find_package: Fix regression on `<PackageName>_ROOT` relative to CWD
d029b828b2 find_package: Avoid repeating search for lower-case .cps file
fc4d238d7a Tests: Match RunCMake.find_package-CPS version candidates more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11277
2025-10-03 11:12:06 -04:00
Brad King
9355a194ca Merge topic 'backport-pkg-root-var' into release-4.0
ab0a44a0a0 find_package: Fix regression on `<PackageName>_ROOT` relative to CWD
d029b828b2 find_package: Avoid repeating search for lower-case .cps file
fc4d238d7a Tests: Match RunCMake.find_package-CPS version candidates more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11277
2025-10-03 11:10:18 -04:00
Kitware Robot
279729b85a CMake Nightly Date Stamp 2025-10-03 00:04:57 -04:00
Vito Gamberini
07518509db Tutorial: Fix example FILE_SET names
FILE_SET names begin with lowercase letters, the examples use uppercase

Fixes #27282
2025-10-02 19:00:43 -04:00
Peter Kokot
fdadbe42fe FindCxxTest: Add CxxTest_FOUND variable and update docs
- This module previously didn't define the CxxTest_FOUND result variable
  consistently if neither Python nor Perl were found.
- Documentation is also updated a bit further to note that Perl-based
  test generator script has been removed in CxxTest version 4.0.
- Internal comments synced.
- Python_FOUND result variable used.

Issue: #27242
2025-10-02 22:31:41 +02:00
Brad King
1a16e4fc69 Merge branch 'backport-pkg-root-var' into pkg-root-var
Use the `-s ours` strategy because we already made equivalent changes.
2025-10-02 15:31:06 -04:00
Robert Maynard
87a661a916 find_package: Fix regression on <PackageName>_ROOT relative to CWD
In commit 9d44a77454 (find_*: Explicitly normalize found paths as they
exist on disk, 2024-10-17, v4.0.0-rc1~597^2~1), we removed path
normalization from the internal `cmSearchPath::AddPathInternal` helper.
Most call sites were updated to normalize input paths first, but search
paths derived from `<PackageName>_ROOT` CMake variables are no longer
normalized.  Instead we normalize the path to the file found after
searching.

When `find_package` "config" mode considers a candidate CMake package
configuration file, normalize its path before loading the adjacent
package version file so that the latter is loaded by absolute path.
Otherwise `cmMakefile::ReadDependentFile` interprets a relative path
with respect to the current source directory rather than the current
working directory.

Fixes: #27279
2025-10-02 15:30:13 -04:00
Brad King
fc059e1978 Merge branch 'backport-pkg-root-var' into pkg-root-var 2025-10-02 15:28:03 -04:00
Robert Maynard
ab0a44a0a0 find_package: Fix regression on <PackageName>_ROOT relative to CWD
In commit 9d44a77454 (find_*: Explicitly normalize found paths as they
exist on disk, 2024-10-17, v4.0.0-rc1~597^2~1), we removed path
normalization from the internal `cmSearchPath::AddPathInternal` helper.
Most call sites were updated to normalize input paths first, but search
paths derived from `<PackageName>_ROOT` CMake variables are no longer
normalized.  Instead we normalize the path to the file found after
searching.

When `find_package` "config" mode considers a candidate CMake package
configuration file, normalize its path before loading the adjacent
package version file so that the latter is loaded by absolute path.
Otherwise `cmMakefile::ReadDependentFile` interprets a relative path
with respect to the current source directory rather than the current
working directory.

Fixes: #27279
2025-10-02 15:24:47 -04:00