Previously a versioned name in a later search path was preferred
over an unversioned name adjacent to the compiler. Consider all
names in each directory before moving to the next directory.
A step with a custom command shouldn't be seen as out-of-date
just because the user re-runs configure with a different log level.
Previously, the log level was written directly to the step scripts,
but that meant the script changes if the user specifies a different
effective log level to the previous configure. Now we move the
log level detection into the script so that the script remains the
same no matter what log level the user asks for.
This was most noticeable with the PATCH step, since that always
uses a custom command when present. Changing the log level
would cause the PATCH step to re-run, which usually results in
an error because PATCH typically only expects to run once after
a DOWNLOAD. But the underlying problem would affect any step
with a custom command, not just PATCH.
Fixes: #28055
d8ade0500e Find{BLAS,LAPACK}: Provide full paths in `{BLAS,LAPACK}_LIBRARIES` with NVPL
cdf4234bc4 Find{BLAS,LAPACK}: Only search for the needed components of NVPL
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12484
Documentation as of CMake 4.4.3 states that these variables provide full
paths to libraries, so some existing consumers expect it.
NVPL provides imported targets that set `IMPORTED_LOCATION_RELEASE`.
Fixes: #28073
Some .pc files (e.g. DPDK) use -l:libfoo.a for an exact library file, but
we passed the colon to find_library and it never resolved. Strip it for
lookup, keep the token so an unresolved lib still falls back to -l:.
Fixes: #27452
Remove the outdated promise of absolute paths in `_LIBRARIES`.
The "using full path name" phrasing was left from before imported
targets were a thing.
Issue: #28073
5b416cbe77 ci: add job testing cuda13.2 with clang
64dac60df9 ci: Update cuda13.2-x86_64 base image to clang-23
ce3d0af576 Clang/CUDA: Support the llvm23+ offload linker model
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12052
Otherwise, `project(LANGUAGES HIP)` fails to configure on a machine
with no AMD GPU when using Clang 22 or newer:
Failed to find a default HIP architecture.
The default architecture is determined by running `rocm_agent_enumerator`,
which returns nothing when no GPU is present, and then by matching
` -target-cpu ([a-z0-9]+) ` in the compiler's cc1 output. Clang stopped
passing `-target-cpu` for AMDGPU in LLVM/Clang commit bf9fe776748c
(clang/AMDGPU: Stop passing redundant -target-cpu to cc1, 2026-08-31);
the processor is now carried in the triple's subarch field. Neither
path matches, so configuration fails.
Fall back to reading the subarch out of the triple, e.g.,
`amdgpu9.06-amd-amdhsa` for `gfx906`. Keep the `-target-cpu` branch for
older compilers. Generic targets spell the subarch with fewer
components, e.g., `amdgpu10.3--` for `gfx10-3-generic`. Those are not
matched, so they still reach the existing error rather than producing an
invalid architecture name.
Both architectures appear in object files, so add both of them to
`CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID` too. We already do this for
multiple `CMAKE_OSX_ARCHITECTURES` on Apple platforms.
Fixes: #28067
The `gcc -v -Wl,-v` debug output does not quote or escape spaces, so
`separate_arguments(... NATIVE_COMMAND ...)` separates on spaces in
paths. Separate on ` -L` and ` -l` instead.
Fixes: #28056
The `gcc -v` output includes a "Configured with" line about its own
build environment. Use it only for the fallback from commit 78b7ba6494
(LinkerId: Fix detection of linker tool for GNU on SunOS sparc32,
2023-12-19, v3.29.0-rc1~176^2~8).
Previously our NSIS project template hard-coded `$INSTDIR\bin` for
inclusion in the `PATH`. If the directory does not exist, nothing is
done. Use `CPACK_NSIS_EXECUTABLES_DIRECTORY` instead of `bin`.
Fixes: #15635
Revert commit a324c2bb58 (GoogleTest: Base on builtin command
discover_tests, 2026-03-01, v4.4.0-rc1~30^2). The `discover_tests`
implementation does not persist already-discovered tests across ctest
runs, making it much slower on projects whose test binaries take a while
just to start up and list tests. Revert to the prior implementation
pending caching support in `discover_tests`.
Fixes: #28053
Issue: #28060
Commit c3c95f3010 (GoogleTest: Avoid generation error on duplicate
target test discovery, 2026-07-14, v4.4.1~24^2) has added a level of
indentation which made rebasing other changes harder than necessary.
Avoiding an else branch after a return command allows keeping the
original indentation.
Projects that explicitly use LANGUAGES NONE, e.g. to install only
data files, have no target architecture, which is intentional.
Default to `lib` without warning.
Fixes: #23461
Extend commit a8e7a1047a (GNU: Do not use -isystem with gfortran,
2015-03-26, v3.3.0-rc1~292^2) to cover classic Flang too. It does
not search system include directories for Fortran `.mod` files.
a2e6306c27 GenEx/LINK_LIBRARY: Add NEEDED_LIBRARY support on Linux
158b64688f Linker/GNU: Refactor LINKER_PUSHPOP_STATE_SUPPORTED check to a function
0f784069c3 Tests: Consolidate RunCMake.target_link_libraries-LINK_LIBRARY conditions
6491bd5a5f Help: Format LINK_LIBRARY NEEDED_LIBRARY platforms as a definition list
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12410
Splitting up the computation of common variables, module build
variables, and object build variables to make it a little easier to
focus on each one.
Updated tests to reflect updated flag order and updated object-build
description.
e4a37fbf15 Tests/RunCMake/Swift: Add CMP0195 behavior checks
b7a78568c3 CMP0215: Update NEW behavior to require CMP0157/CMP0195 to be NEW
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12407
Update CMP0215 to avoid attempting to iterate through the flags
looking for `-emit-module-path` ins the user-specified flags. We don't
do this anywhere else in the code. The existing implementation didn't
handle correctly parsing the flag so `-I blah/my-emit-module-path/` and
`-Xcc -emit-module-path ...` would both trigger it, result in the
compiler not emitting any module. Furthermore, it didn't include the
user-specified module path as part of the build graph resulting in an
incorrect build graph that would never resolve.
The only two appropriate layouts for the module are either the flat
binary module file with the name `<module-name>.swiftmodule`, or the
nested form with
`<module-name>.swiftmodule/<module-triple>.swiftmodule`. The noted
Swift-Syntax situation passes the explicit `-emit-module-path` to get to
the latter form. This form is automatically emitted by CMake when
CMP0195 is `NEW`, removing the need for the flag. The Swift project
generally recommends the nested directory structure since it gathers all
of the generated interface outputs from the compiler (textual swift
interfaces, swiftdoc, sourceinfo, and the binary swiftmodule file) in a
single place, and since it uses the module triple in the filename,
cleanly allows fat mach-o binaries on Apple platforms.
Fixes: #28021