Commit Graph

71268 Commits

Author SHA1 Message Date
Brad King
a2f4f74ed3 Merge branch 'release-4.0' into release-4.1 2025-10-03 11:13:58 -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
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
Brad King
d029b828b2 find_package: Avoid repeating search for lower-case .cps file 2025-10-02 15:24:47 -04:00
Brad King
fc4d238d7a Tests: Match RunCMake.find_package-CPS version candidates more precisely
Since commit 3e6466eb16 (find_package: Honor version requests when
finding CPS packages, 2025-02-12, v4.0.0-rc1~16^2) the test has relied
on `.*` to absorb capitalized paths on case-insensitive filesystems.
Match them explicitly.
2025-10-02 15:24:12 -04:00
Brad King
9cab1062e4 Merge branch 'release-4.0' into release-4.1 2025-10-02 13:57:11 -04:00
Brad King
9f7179793b Merge topic 'build-graph-opt-docs' into release-4.1
fac5e622b7 Help/OPTIMIZE_DEPENDENCIES: xref with CMP0154 documentation
03f5ffa2ca Help/OPTIMIZE_DEPENDENCIES: move period outside of parenthetical

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11275
2025-10-02 13:56:25 -04:00
Brad King
375307f4d7 Merge topic 'build-graph-opt-docs' into release-4.0
fac5e622b7 Help/OPTIMIZE_DEPENDENCIES: xref with CMP0154 documentation
03f5ffa2ca Help/OPTIMIZE_DEPENDENCIES: move period outside of parenthetical

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11275
2025-10-02 13:55:34 -04:00
Ben Boeckel
fac5e622b7 Help/OPTIMIZE_DEPENDENCIES: xref with CMP0154 documentation
Closes: #27250
2025-09-30 22:59:04 -04:00
Ben Boeckel
03f5ffa2ca Help/OPTIMIZE_DEPENDENCIES: move period outside of parenthetical
The preceding sentence needs a terminator.
2025-09-30 22:58:34 -04:00
Brad King
11f3f34077 CMake 4.1.2 v4.1.2 2025-09-30 10:48:33 -04:00
Brad King
aec52661a3 Merge topic 'genex-transitive-link-libraries' into release-4.1
e0bbe79cea CMP0189: Restore support for linking `$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>`
cb69f750bf cmGeneratorTarget: Factor out helper to detect LINK_LIBRARIES evaluation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11262
2025-09-30 09:59:07 -04:00
Brad King
e0bbe79cea CMP0189: Restore support for linking $<TARGET_PROPERTY:tgt,LINK_LIBRARIES>
In general we disallow references to transitive target properties, such
as `COMPILE_DEFINITIONS`, in `[INTERFACE_]LINK_LIBRARIES` properties,
because the latter establish the transitivity itself.  Prior to CMP0189,
the `[INTERFACE_]LINK_LIBRARIES` properties were not themselves transitive
in `$<TARGET_PROPERTY>` expressions, so existing projects have code like

    target_link_libraries(foo PRIVATE "$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>")

Policy CMP0189's NEW behavior, introduced by commit b3da9c6d60 (GenEx:
Evaluate LINK_LIBRARIES target properties transitively, 2025-02-24,
v4.1.0-rc1~731^2), makes `$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>`
transitive, causing the above to be rejected.  Since evaluation of a
target's link libraries can already encounter and handle other targets'
link libraries, allow it in this case.

Fixes: #27265
2025-09-29 10:51:01 -04:00
Brad King
cb69f750bf cmGeneratorTarget: Factor out helper to detect LINK_LIBRARIES evaluation 2025-09-26 17:41:41 -04:00
Brad King
24ede8c516 Merge branch 'release-4.0' into release-4.1 2025-09-25 09:01:35 -04:00
Brad King
c4095eaf86 Merge branch 'release-3.31' into release-4.0 2025-09-25 09:01:23 -04:00
Brad King
7ef733450c Merge topic 'bootstrap-devirtualization' into release-4.1
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11243
2025-09-25 09:00:39 -04:00
Brad King
21bc83344c Merge topic 'bootstrap-devirtualization' into release-4.0
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11243
2025-09-25 08:58:51 -04:00
Brad King
2303c04c20 Merge topic 'bootstrap-devirtualization' into release-3.31
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11243
2025-09-25 08:57:57 -04:00
Brad King
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization
Avoid including a header for a subclass whose implementation is not
compiled during bootstrap.

Fixes: #27256
2025-09-24 17:20:35 -04:00
Brad King
98961a7dd4 Merge branch 'release-4.0' into release-4.1 2025-09-24 14:07:54 -04:00
Brad King
a2faa7af28 Merge branch 'release-3.31' into release-4.0 2025-09-24 14:07:42 -04:00
Brad King
622044ce33 CMake 3.31.9 v3.31.9 2025-09-24 13:24:34 -04:00
Brad King
e46097dbfa Merge topic 'file-GENERATE-CMP0189' into release-4.1
deb7b4b658 file(GENERATE): Record CMP0189 at each call site
9b862e7013 cmGeneratorTarget: Pass genex evaluation context to IsTransitiveProperty

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11234
2025-09-24 08:45:12 -04:00
Brad King
deb7b4b658 file(GENERATE): Record CMP0189 at each call site
Policy CMP0189, introduced by commit b3da9c6d60 (GenEx: Evaluate
LINK_LIBRARIES target properties transitively, 2025-02-24,
v4.1.0-rc1~731^2), takes effect at generation time, and so uses the
policy value as of the end of each directory.  However, some projects
may rely on `file(GENERATE)` with the policy's OLD behavior in order
to extract targets' *direct* dependencies from `LINK_LIBRARIES`.
Pending a first-class solution to that problem, make it easier for
projects to port to the policy's NEW behavior in general while
retaining the OLD behavior in an isolated context.

Fixes: #27220
2025-09-23 11:30:22 -04:00
Brad King
9b862e7013 cmGeneratorTarget: Pass genex evaluation context to IsTransitiveProperty 2025-09-23 10:57:22 -04:00
Brad King
6201ff1864 Merge topic 'doc-CMP0189' into release-4.1
e8d779c935 Help: Document when policy CMP0189 takes effect

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11230
2025-09-23 09:14:14 -04:00
Brad King
e8d779c935 Help: Document when policy CMP0189 takes effect
This was left out of commit b3da9c6d60 (GenEx: Evaluate LINK_LIBRARIES
target properties transitively, 2025-02-24, v4.1.0-rc1~731^2).

Issue: #27220
2025-09-22 15:21:05 -04:00
Brad King
7cfe68619b Merge topic 'genex-refactor' into release-4.1
77570a1ac1 GenEx: Consolidate target property evaluation context arguments
1735b0d147 GenEx: Construct cmGeneratorExpressionDAGChecker with full evaluation context
d4d204382f GenEx: Collect evaluation arguments into local Context structures
b40a53e931 GenEx: Factor out a dedicated evaluation Context structure
e1035dc307 GenEx: Rename cmGeneratorExpressionContext to cm::GenEx::Evaluation
905cfcfa12 cmGeneratorExpressionNode: Simplify EvaluateDependentExpression signature
fe8e82090b cmGeneratorExpressionEvaluationFile: Constify some local generator usage
8321178a23 cmFileSet: Constify local generator usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11224
2025-09-22 10:14:26 -04:00
Brad King
77570a1ac1 GenEx: Consolidate target property evaluation context arguments 2025-09-21 20:20:03 -04:00
Brad King
1735b0d147 GenEx: Construct cmGeneratorExpressionDAGChecker with full evaluation context
Extend commit e8010b67c7 (cmGeneratorExpressionDAGChecker: Make local
generator available in constructor, 2024-04-25, v3.30.0-rc1~172^2~6) and
commit 633afa0b2e (cmGeneratorExpressionDAGChecker: Make config name
available in constructor, 2024-05-08, v3.30.0-rc1~82^2~2) to make the
full evaluation context available in the constructor.
2025-09-21 20:20:03 -04:00
Brad King
d4d204382f GenEx: Collect evaluation arguments into local Context structures 2025-09-21 20:17:16 -04:00
Brad King
b40a53e931 GenEx: Factor out a dedicated evaluation Context structure
The context's local generator, configuration name, and language are
constant throughout evaluation.
2025-09-21 18:58:55 -04:00
Brad King
e1035dc307 GenEx: Rename cmGeneratorExpressionContext to cm::GenEx::Evaluation
It has grown to hold information about the evaluation itself,
not just the context in which the evaluation occurs.
2025-09-21 18:58:55 -04:00
Brad King
905cfcfa12 cmGeneratorExpressionNode: Simplify EvaluateDependentExpression signature
The local generator is available in the evaluation context.
2025-09-21 18:58:55 -04:00
Brad King
fe8e82090b cmGeneratorExpressionEvaluationFile: Constify some local generator usage 2025-09-21 18:58:55 -04:00
Brad King
8321178a23 cmFileSet: Constify local generator usage 2025-09-21 18:58:55 -04:00
Brad King
6de0334c9c Merge branch 'release-4.0' into release-4.1 2025-09-21 18:57:43 -04:00
Brad King
72fcfe5b36 Merge topic 'ci-xcode-26' into release-4.1
965a12cb8a ci: update macOS jobs to use Xcode 26.0
edaa6ed06a Tests: Teach RunCMake to ignore Xcode an IDERunDestination warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11209
2025-09-21 18:56:48 -04:00
Brad King
90e1300983 Merge topic 'ci-xcode-26' into release-4.0
965a12cb8a ci: update macOS jobs to use Xcode 26.0
edaa6ed06a Tests: Teach RunCMake to ignore Xcode an IDERunDestination warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11209
2025-09-21 18:56:09 -04:00
Brad King
965a12cb8a ci: update macOS jobs to use Xcode 26.0 2025-09-19 08:19:34 -04:00
Brad King
edaa6ed06a Tests: Teach RunCMake to ignore Xcode an IDERunDestination warning
On some Xcode versions, `xcodebuild` may warn:

    ... xcodebuild[...] IDERunDestination: ...

Teach RunCMake to drop such incidental lines before matching against
expected output.
2025-09-19 08:19:34 -04:00
Brad King
3b95dadd08 Merge topic 'lfortran-0.55' into release-4.1
3b85cc1a8e Tests: Extend RunCMake.ParseImplicitLinkInfo for LFortran 0.55.0
7e8f76dad2 LFortran: Update flags renamed by version 0.55

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11184
2025-09-16 08:50:40 -04:00
Brad King
3b85cc1a8e Tests: Extend RunCMake.ParseImplicitLinkInfo for LFortran 0.55.0 2025-09-15 20:34:16 -04:00
Christopher Albert
7e8f76dad2 LFortran: Update flags renamed by version 0.55
The `--generate-object-code` flag is now `--separate-compilation`.

Fixes: #27225
2025-09-15 20:34:16 -04:00
Brad King
31fd368e80 Merge topic 'GNUInstallDirs-cached-default' into release-4.1
2e88a3efc2 GNUInstallDirs: Fix regression on -DCMAKE_INSTALL_<dir>=<default> in /usr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11167
2025-09-11 13:05:19 -04:00