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
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
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
8dfc725cdb PathResolver: Add mode to collapse paths naively and look up on-disk case
75913fe430 PathResolver: Document in comments the on-disk case lookup on macOS
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10438
This change has no impact because the incorrect XML is technically
valid and the Fortran VS extension ignores the ProjectGUID attribute
anyway.
Fixes: #11437
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
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
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
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
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>
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.
5a36d0c9e7 Ninja: Fix regression with a large number of subdirectories
a30cf4a66a Tests/RunCMake/Configure: Split ninja-specific RerunCMake case
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10420
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
e2f03680b3 Merge branch 'backport-license-rst' into license-rst
e89ca6e4df Merge branch 'backport-license-rst' (early part) into license-rst
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
67b6964efa Merge branch 'backport-license-rst' (early part) into license-rst
2f852580fb CONTRIBUTORS: Improve formatting of per-contributor hyperlinks
8d83487e60 CONTRIBUTORS: Factor contributors list out of license file
1fd8a2be4d LICENSE: Clarify role of copyright in contributions
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !10416
This adds a `CMAKE_FIND_REQUIRED` variable which causes `find_package`,
`find_path`, `find_file`, `find_library` and `find_program` to be
considered `REQUIRED` by default.
It also introduces an `OPTIONAL` keyword to those commands, allowing
them to ignore the value of this variable.
Issue: #26576
`difftime` returns a `double`, so commit 6727270b75 (CMake: Extend
TIMESTAMP sub-commands with new unix time format specifier, 2016-02-16,
v3.6.0-rc1~338^2) cast it to `long` to get an integer result. However,
in the MSVC ABI, `long` is a 32-bit integer. Use an explicit 64-bit
integer type instead.
Fixes: #26716
Previously the presets handler in the GUI was on a timer. Because of
this, error messages got suppressed after the first one (even if the
error message is different from the one originally suppressed).
Add a "reload presets" button which forces the preset to reload, and
always provides an error message if the reload failed.
Fixes: #26707
XCode 16+ no longer delays our POST_BUILD phase until after bundle files
like `Info.plist` are generated. Teach the Xcode generator to add
explicit dependencies to the POST_BUILD phase in bundle targets to
ensure the files are created before it runs.
Fixes: #26656
Modify how cmExportBuildFileGenerator::FindExportInfo collects target
export information to properly record the export sets which export a
target. (The old behavior treated every invocation as a separate set,
which is reasonable for export(TARGETS) but does not allow referencing a
target exported multiple times via export(EXPORT). This reflects recent
changes to allow this for installed exports.)
The `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` target properties
establish the graph of link dependencies used to propagate usage
requirements transitively. Therefore the `$<TARGET_PROPERTY:...>`
generator expression should evaluate them transitively as it does for
other transitive properties. Add policy CMP0189 for compatibility.
Fixes: #26709
Issue: #12435