Commit Graph

37066 Commits

Author SHA1 Message Date
Brad King
0cd7adb881 CMake 4.0.0-rc5 2025-03-21 09:34:42 -04:00
Brad King
8214004200 Merge topic 'GNU-linker-pushpop_state-detection' into release-4.0
d5be7c7f31 Linker: Detect GNU push-state/pop-state flags more robustly
7b552b9a64 Linker: Save GNU push-/pop-state detection with compiler inspection results
a9b126b0da Linker: Save linker inspection results with compiler inspection results
3f5f2b2d49 Linker: Honor CMAKE_<LANG>_LINK_LIBRARY_USING_FEATURE_SUPPORTED when FALSE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10468
2025-03-21 08:07:13 -04:00
Marc Chevrier
a9b126b0da Linker: Save linker inspection results with compiler inspection results
Reconfigure `CMake<LANG>Compiler.cmake` again after linker information
is detected.
2025-03-20 11:00:02 -04:00
Marc Chevrier
3f5f2b2d49 Linker: Honor CMAKE_<LANG>_LINK_LIBRARY_USING_FEATURE_SUPPORTED when FALSE
It is documented to override `CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED`.
2025-03-20 10:59:01 -04:00
Martin Duffy
39f365ec3c instrumentation: Unique snippet file names
Updates the hash in snippet file naming to take the ProcessId into account
so that snippets with identical commands don't risk a collision in filename.

Additionally, this adds a `workingDir` to snippet files so that snippets with
identical commands can be more easily differentiated, such as with install
snippets.
2025-03-18 13:23:02 -04:00
Martin Duffy
d723409e8e export: Allow multiple exports when only one export is installed
Since commit c8997fc046 (export: Allow depending on targets exported
multiple times, 2024-12-26, v4.0.0-rc1~241^2), it is possible to depend
on a target exported multiple times so long as the target is exported in
only one set and with a consistent namespace.  However, as a
side-effect, a target could not be in multiple export sets even if only
one of those sets was installed.

Update the check so that uninstalled export sets do not count towards a
target being exported multiple times.
2025-03-17 18:01:30 -04:00
Brad King
df2ec408c9 Merge topic 'cps-fix-default-configs' into release-4.0
63c96e76f9 cmPackageInfoReader: Fix default configurations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10469
2025-03-14 12:06:40 -04:00
Matthew Woehlke
63c96e76f9 cmPackageInfoReader: Fix default configurations
Fix two minor issues with how default configurations are set from CPS
packages. First, imported configurations were (appropriately) being
converted to upper case, but default configurations weren't. Second,
default configurations were being set only after importing components
from the root package configuration file, resulting in configurations
specified in the root file preceding the default configurations.
2025-03-13 14:27:58 -04:00
Brad King
41d91387f6 Merge branch 'backport-3.31-file-MAKE_DIRECTORY-result-var' 2025-03-13 11:58:47 -04:00
Brad King
397ec37528 file(MAKE_DIRECTORY): Do not make directories for command keywords
In commit 95323c90a1 (file(MAKE_DIRECTORY): Add optional RESULT keyword
to capture failure., 2024-06-16, v3.31.0-rc1~414^2) we computed an
updated range of arguments, that name directories to be created, before
the `RESULT` keyword.  However, we forgot to use it in the loop.

Fixes: #26768
2025-03-13 11:57:53 -04:00
Brad King
a039a1655d file(MAKE_DIRECTORY): Clarify formatting of unexpected arguments error 2025-03-13 11:57:27 -04:00
Brad King
90d9c79348 file(MAKE_DIRECTORY): Do not make directories for command keywords
In commit 95323c90a1 (file(MAKE_DIRECTORY): Add optional RESULT keyword
to capture failure., 2024-06-16, v3.31.0-rc1~414^2) we computed an
updated range of arguments, that name directories to be created, before
the `RESULT` keyword.  However, we forgot to use it in the loop.

Fixes: #26768
2025-03-13 11:57:25 -04:00
Brad King
f7f8fd59da CMake 4.0.0-rc4 2025-03-11 13:12:16 -04:00
Brad King
9a81fcb8b8 Merge topic 'realpath-windows' into release-4.0
0a5efe8489 cmSystemTools: Fix GetRealPath implementation on Windows
5910bf0b40 cmSystemTools: Restore GetRealPathResolvingWindowsSubst

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10452
2025-03-11 09:42:29 -04:00
Brad King
1150091f61 Merge topic 'curl-opt-netrc' into release-4.0
1b0c92a3a1 cmCurl: Avoid using undocumented type for CURLOPT_NETRC values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10449
2025-03-11 09:22:43 -04:00
Brad King
0a5efe8489 cmSystemTools: Fix GetRealPath implementation on Windows
In commit 823e1df54c (cmSystemTools: Implement GetRealPath on Windows,
2024-11-04, v4.0.0-rc1~521^2~1) we implemented the POSIX behavior that
resolves symlinks followed by '..' components.  However, Windows just
removes them lexically.  Also, we were not handling all junction types.

Instead, use `GetFinalPathNameByHandleW` via `uv_fs_realpath`.

Note that we previously attempted this in commit 640709e7db
(cmSystemTools: Implement GetRealPath on Windows, 2017-10-02,
v3.11.0-rc1~445^2~1) but reverted it in commit 83630d4918
(cmSystemTools: Revert GetRealPath implementation on Windows,
2018-05-29, v3.11.3~3^2) due to resolving `subst` drives.  This time,
add code to re-`subst`itute the drive in the resolved path.

Fixes: #26750
Issue: #17206
2025-03-10 14:50:09 -04:00
Brad King
5910bf0b40 cmSystemTools: Restore GetRealPathResolvingWindowsSubst
We need it to restore behavior on Windows.  Revert commit 16af27fd42
(cmSystemTools: Drop GetRealPathResolvingWindowsSubst, 2024-11-04,
v4.0.0-rc1~521^2), but with a cleaned up implementation.

Issue: #26750
Issue: #18033
2025-03-10 11:25:23 -04:00
Brad King
1b0c92a3a1 cmCurl: Avoid using undocumented type for CURLOPT_NETRC values
Since upstream curl commit `2ec00372a1` (curl.h: change some enums to
defines with L suffix, 2025-02-25), the `CURL_NETRC_*` constants are
integer literals instead of `enum CURL_NETRC_OPTION`.  It turns out
that `curl_easy_setopt` has always expected a `long` anyway, and
that `CURL_NETRC_OPTION` is not documented for public use.

Fixes: #26754
2025-03-10 11:17:19 -04:00
Brad King
fc5584f9bb cmSystemTools: Fix regression in input path normalization on Windows
Since commit 622596c6b2 (cmSystemTools: Re-implement
ToNormalizedPathOnDisk without translation map, 2024-10-30,
v4.0.0-rc1~528^2~5) we normalize input paths, while resolving symlinks
only if followed by `..` components, by using `cm::PathResolver`'s
`LogicalPath` mode.  However, that approach assumes POSIX semantics for
resolving paths with symlinks and is incorrect on Windows.

On Windows, file system operations naively remove any component
preceding `..` regardless of whether it is a symlink.  Prior to the
above commit, `ToNormalizedPathOnDisk` matched that behavior using
`CollapseFullPath` followed by `GetActualCaseForPath`.  Restore it using
`cm::PathResolver`'s `CasePath` mode.

Issue: #26750
2025-03-07 18:26:14 -05:00
Brad King
8dfc725cdb PathResolver: Add mode to collapse paths naively and look up on-disk case
In CMake 3.31 and below, `CollapseFullPath` did this on Windows.  KWSys
has since stopped looking up the on-disk case in `CollapseFullPath` to
avoid disk access when most callers only need an in-memory operation.
We currently call `GetActualCaseForPath` explicitly when needed.

Add a mode to `cm::PathResolver` to combine these operations and cache
disk access behind the `System::ReadName` callback.  We will use this to
restore the way CMake 3.31 and below normalized input paths on Windows.

Issue: #26750
Issue: #20214
2025-03-07 18:22:46 -05:00
Brad King
75913fe430 PathResolver: Document in comments the on-disk case lookup on macOS
This was added by commit 08040ced86 (cmake: Look up on-disk case of
input paths on macOS, 2024-11-20, v4.0.0-rc1~390^2).  Update relevant
comments.
2025-03-07 18:14:57 -05:00
Brad King
f68bd58c9f Merge topic 'cmake-gui-incidental-errors' into release-3.31
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
2025-03-07 12:14:00 -05:00
Brad King
e8b7c9c975 Merge topic 'cmake-gui-incidental-errors' into release-4.0
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
2025-03-07 12:10:16 -05:00
Juan Ramos
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees
Since commit a872844908 (cmake-gui: Handle relative paths in the build
directory text input, 2024-04-24, v3.30.0-rc1~5^2), `cmake-gui` gave an
incidental error message even when a valid build directory was being
passed.  Fix this by checking for a non-empty path before using it.

Fixes: #26744
2025-03-06 11:13:06 -05:00
Daniel Pfeifer
712cb8cb14 ctest: Restore support for -T Test without dashboard configuration
Since commit 774fcbe49c (CTest: Base command line mode on top of
scripting commands, 2024-10-05, v4.0.0-rc1~653^2) we drive dashboard
client steps through `cmCTestHandlerCommand::ExecuteHandlerCommand`
instead of calling `ProcessHandler` directly.  This requires the
`BuildDirectory` to be known to establish a work directory.

Fixes: #26743
Co-authored-by: Brad King <brad.king@kitware.com>
2025-03-06 09:43:22 -05:00
Daniel Pfeifer
e47dc29967 cmCTestStartCommand: Remove unnecessary code
We called `UpdateCTestConfiguration` but set an internal option
that made it a no-op.  Instead, just do not call it.
2025-03-06 09:43:22 -05:00
Brad King
f54699d31d cmCTest: De-duplicate working directory code 2025-03-06 09:43:22 -05:00
Matthew Woehlke
c3d279841b find_package: CPS component requirements != CMake components
Modify how CMake handles required components of a CPS transitive
dependency to not pass them as COMPONENTS if a CMake-script package is
found as the resolved dependency. This is necessary as many CMake-script
package description files do not treat component requests as target
requests (which, in CPS-land, they effectively are), but do implement
logic to mark themselves 'not found' if requested components are
missing. As a result, passing in the required targets as required
components is likely to cause the dependency to be spuriously not found
if it is only available via a CMake-script package configuration file.

Fix this by introducing a new 'required targets' concept, and by passing
CPS component requirements as both required targets and optional
components. The latter serves as a hint for packages that might provide
only a subset of themselves. The former is used to post-validate a
CMake-script package, or is folded on-the-fly into required components
when considering CPS packages.

Note that this functionality is not exposed to the user at this time,
and is only used when resolving transitive dependencies for a CPS
package.
2025-03-05 14:47:49 -05:00
Brad King
bc51d06814 CMake 4.0.0-rc3 2025-03-05 09:08:59 -05:00
Ben Boeckel
5a36d0c9e7 Ninja: Fix regression with a large number of subdirectories
Since commit f50fb77a4f (Ninja: Regenerate when test or install scripts
are missing, 2024-10-29, v4.0.0-rc1~516^2) the list of paths we pass to
`ninja -t restat` scales with the number of project subdirectories.
Run it in blocks to avoid "command line too long" errors, particularly
on Windows.

Fixes: #26738
2025-03-04 13:37:01 -05:00
Brad King
8d83487e60 CONTRIBUTORS: Factor contributors list out of license file
It is more conventional to list contributors in a dedicated file.
Also drop the long out-of-date sponsorship section.
2025-03-03 09:56:17 -05:00
Kitware Robot
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Brad King
2d42a5444f LICENSE: Rename Copyright.txt to LICENSE.rst
The name `LICENSE` is now more conventional.
Format as reStructuredText to improve rendering.
2025-03-03 09:55:56 -05:00
Brad King
3035ee4ff3 CMake: De-duplicate extraction of copyright line from license file 2025-03-03 08:59:09 -05:00
Brad King
068ea4bfc1 cmake-gui: Update credits in About dialog to reflect status quo 2025-03-03 08:59:08 -05:00
Brad King
547c42b294 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-03-01 (1d82baee)
2025-03-01 10:06:13 -05:00
Brad King
5dd973f900 ci: Convert sunos packaging jobs to build sunos-{x86_64,sparc64} binaries 2025-02-27 16:35:09 -05:00
Brad King
4972938b7d CMake 4.0.0-rc2 2025-02-25 10:56:02 -05:00
Martin Duffy
4e7b37cad3 instrumentation: Quote command arguments to preserve separation
Fixes: #26702
2025-02-24 13:11:19 -05:00
Martin Duffy
99cd4d979b CTest: Fix startTime in test snippets when using instrumentation
Initialize SystemStartTime for TestProcess.
2025-02-24 11:50:11 -05:00
Brad King
859ca5c4d7 CMake 3.31.6 2025-02-24 10:53:17 -05:00
Brad King
2bd6fbe1b0 CMake 3.30.8 2025-02-24 10:09:52 -05:00
Brad King
77c7397ab4 Merge branch 'backport-3.31-custom-transitive-properties' 2025-02-23 08:36:56 -05:00
Brad King
478d6cfd9a Merge branch 'backport-3.30-custom-transitive-properties' 2025-02-23 08:33:12 -05:00
Brad King
8b5af40b34 GenEx: Fix evaluation of LINK_LIBRARIES as custom transitive property
Fix logic from commit b9ee79b8a1 (GenEx: Add support for custom
transitive compile properties, 2024-05-09, v3.30.0-rc1~82^2~1) to more
precisely know when we are computing the link dependency graph.

Issue: #20416
Issue: #26709
2025-02-23 08:30:42 -05:00
Brad King
161f703e76 GenEx: Restore evaluation context for conditional transitive properties
In commit e8010b67c7 (cmGeneratorExpressionDAGChecker: Make local
generator available in constructor, 2024-04-25, v3.30.0-rc1~172^2~6)
we accidentally failed to preserve `EvaluateInterfaceProperty`'s
consistency with `TargetPropertyNode::Evaluate`.  Fix its local
generator selection to match the evaluation context.
2025-02-23 08:30:33 -05:00
Brad King
5ac3cca63d Merge branch 'backport-3.31-custom-transitive-properties' (early part) 2025-02-22 09:41:13 -05:00
Brad King
2ccbad90e6 cmGeneratorExpressionDAGChecker: Construct with initializer list syntax 2025-02-22 09:11:20 -05:00
Brad King
99fee5720d cmGeneratorExpressionDAGChecker: De-duplicate constructor signature 2025-02-22 08:46:44 -05:00
Brad King
82151ea289 cmGeneratorExpressionDAGChecker: Construct with initializer list syntax 2025-02-22 08:33:20 -05:00