78225 Commits
Author SHA1 Message Date
Kitware Robot 2061675bfd CMake Nightly Date Stamp 2026-10-30 00:08:33 -04:00
Tyler Yankee 2ac0d35159 Genex: Diagnose cyclic link information
A generator expression such as `$<TARGET_RUNTIME_DLLS:tgt>` reachable
from the link closure of `tgt` causes a nested re-entry into
`GetLinkInformation`. This computation runs over a partially computed
link implementation and leads to bogus generation errors or a crash.

Reserve the cache entry before computing, and error out when the
computation is re-entered.
2026-10-29 15:41:22 -04:00
Tyler Yankee c5898ce603 CPS: Fix crashes on invalid versions
The current parsing doesn't handle special cases very well, such as
spaces (entirely space, or leading whitespace) and overflows.
2026-10-29 14:44:21 -04:00
Miro Hrončok 959098d148 FindPython: Add support for Python 3.16 2026-10-29 13:32:07 -04:00
Daksh Mamodiya 14d7dd02d2 FindOpenMP: Add OpenMP::OpenMP_<lang>_Offload targets
OpenMP::OpenMP_<lang> carries no device flags, and for GCC and Clang
links the OpenMP runtime without the OpenMP flag, so target regions
built through it fail to link or silently run on the host.  Once
OpenMP_<lang>_OFFLOAD or OpenMP_<lang>_OFFLOAD_FLAGS is set, the new
targets add the device flags, plus the OpenMP flag at link time;
otherwise they match the host targets.  FindOpenMP.Offload runs a
target kernel on a GPU and is enabled in the nvhpc job.

Fixes: #21784, #26701
2026-10-29 17:12:29 +01:00
Naropanth Srikar Rao 06440c35f6 AIX: support VERSION/SOVERSION symlinks for plain shared objects
On AIX, when AIX_SHARED_LIBRARY_ARCHIVE is off, VERSION and SOVERSION
were ignored and only a single `lib<name>.so` was produced.

Add the AIX_SHARED_LIBRARY_SYMLINKS target property, initialized by the
CMAKE_AIX_SHARED_LIBRARY_SYMLINKS variable, to name the shared object
`lib<name>.so.<version>` and create `lib<name>.so.<soversion>` and
`lib<name>.so` symlinks, as on other UNIX platforms.  When the property
is not set, policy CMP0227 selects the default.

AIX shared objects have no builtin soname, so a dependent records the
name of the file used to link it.  Link dependents through the
`lib<name>.so.<soversion>` symlink so they need not be rebuilt for a
compatible update.  If only VERSION is set, link to
`lib<name>.so.<version>`.

Extend the SharedLibraryArchive test to check the file names, symlinks,
and the library name recorded by dependents.
2026-10-29 12:04:33 -04:00
Naropanth Srikar Rao edd2712a34 cmGeneratorTarget: Replace GetFullPath realname parameter with an enum
This makes call sites more readable.
2026-10-29 12:04:33 -04:00
Naropanth Srikar Rao 84a54323d3 Tests: Do not run LinkStatic test on AIX
System archive libraries like `/usr/lib/libm.a` contain shared objects.
2026-10-29 12:04:33 -04:00
Alexandre Zollinger Chohfi a14c8ff8ea cmake, ctest, cpack: Delay-load Windows system libraries
`cmake.exe`, `ctest.exe` and `cpack.exe` import several Windows system
libraries directly, so the loader maps them, and the libraries they
depend on, every time one of the tools starts.  Many runs use none of
them, including most `cmake -E` commands, which run many times in
every build.

When building with MSVC or clang-cl, link the three tools with
`-DELAYLOAD` for these libraries so each one is loaded on first use.

Issue: #28164
2026-10-29 11:45:42 -04:00
scivision 57c68e39ea cm::filesystem: Restore detection of std::filesystem support on Windows
Since commit b86a77e8c8 (cm::filesystem::path: ensure independence from
the program locale., 2026-01-05, v4.3.0-rc1~185^2) detection always
fails due on Windows to using `fs` instead of `std::filesystem`.

Also remove the `weakly_canonical` check I added in commit ad4481fa00
(Source: Enhance check for C++17 filesystem support, 2023-12-02,
v3.29.0-rc1~296^2).  It was a bad idea since it accesses the filesystem,
and so in general this can give false negative say in the case of
`CMAKE_BINARY_DIR` being on a symlinked drive.

Fixes: #28221
2026-10-29 11:09:05 -04:00
Brad King cda028d08c Merge topic 'update-libarchive'
9608d421c7 Utilities: Update hard-coded try_compile results for libarchive 3.8.10
a855f0d0c4 libarchive: Set build options the way we need for CMake
1acae99df2 libarchive: Add cm3p prefixes on includes new to 3.8.10
0baf44d025 Merge branch 'upstream-LibArchive' into update-libarchive
fd7af8dc6d LibArchive 2026-10-14 (0c48412b)
5956f9d466 libarchive: Update script to get 3.8.10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12732
2026-10-29 11:08:49 -04:00
Brad King 54c05ba479 Merge topic 'cmake-version-skip-default-gen'
da59d7769e cmake: Find the default generator only when printing the generator list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12731
2026-10-29 11:07:34 -04:00
Brad King 47004d0a7b Merge topic 'export-use-attributes'
1e5e049c02 GenerateExportHeader: use C++11 attributes if available

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Christian Heimlich <chris@pcserenity.com>
Merge-request: !7009
2026-10-29 11:06:12 -04:00
Brad King 76bcd975c1 Merge topic 'update-kwiml'
c5986881ab Merge branch 'upstream-KWIML' into update-kwiml
8c775567f4 KWIML 2026-10-28 (b1882c31)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12728
2026-10-29 10:58:40 -04:00
Tyler Yankee 63e7673d0b FindDoxygen: Tolerate empty output formats
Amend commit 8fc8f564c9 (FindDoxygen: Create and clean recursive
subdirectories for output formats, 2026-08-09) to avoid syntax errors
with undefined variables.

Fixes: #28222
2026-10-29 09:30:36 -04:00
Tyler Yankee bc7346c06b Help/if: Fix indentation level of if(DEFINED) 2026-10-29 09:30:34 -04:00
Tyler Yankee 0d4e76e882 Help: Add CTest Dashboard Client Guide
Add a guide page to replace the old tutorial step which helps get users
started on the different workflows for dashboard client mode.
2026-10-29 09:19:48 -04:00
Tyler Yankee 6a507e9ae9 Help/ctest: Document remaining script variables for dashboard settings
Some have gone historically "undocumented" in that they are listed in
`ctest(1)` and are intended for public use, but aren't listed in
`cmake-variables(7)` with their own variable pages.
2026-10-29 09:14:51 -04:00
Tyler Yankee b827b48c74 Help/ctest: Add Dashboard Client workflow overview
Distinguish between `ctest -D` and `ctest -S` modes. Include a simple
example of a driver script to get users started.
2026-10-29 09:14:49 -04:00
Tyler Yankee 64ca71c578 CTest: Document target names reserved for the dashboard 2026-10-29 09:14:48 -04:00
Tyler Yankee d31409f51f Help/ctest: Add some clarifications for Dashboard Client mode 2026-10-29 09:14:47 -04:00
Tyler Yankee b4e408d7d9 cmGeneratorExpressionNode: Fix check to CMP0199
Avoid dereferencing nullptr.
2026-10-29 07:31:45 -04:00
Kitware Robot 9325f204e5 CMake Nightly Date Stamp 2026-10-29 00:06:18 -04:00
Christoph Grüninger e67a011e90 ccmake: Do not leak long message forms
The forms showing configure/generate output, help, and the log were
allocated with new and never deleted.  Make them local objects, and
point CurrentForm back to the main form as soon as they are closed so
the resize handler never sees a destroyed form.
2026-10-28 23:39:52 +01:00
Christoph Grüninger 952a327c7b ccmake: Delete main form on exit after a failed configure
When Configure() or Generate() failed with -2 (e.g. no CMakeLists.txt
in the source directory) they returned while CurrentForm still pointed
at the message form.  main() then deleted that form instead of the main
form, leaking the main form together with its cmake instance.
2026-10-28 23:37:39 +01:00
Christoph Grüninger 5532f2c69d ccmake: Free main form before destroying cache entry fields
InitializeUI() replaced the cache entry widgets and the "EMPTY CACHE"
placeholder, and RemoveEntry() erased an entry, while the form still
referenced their fields.  free_field() fails on connected fields, so
every reconfigure and every deleted entry leaked fields.  Free the form
first; RePost() and Render() create a new one afterwards.
2026-10-28 23:36:10 +01:00
Christoph Grüninger 1835cffe66 ccmake: Free long message form before its field
free_field() refuses to free a field that is still connected to a form
and returns E_CONNECTED.  ~cmCursesLongMessageForm freed its field
before the base class destructor freed the form, so the field and its
buffer leaked every time a long message form was destroyed.
2026-10-28 23:34:15 +01:00
Brad King 9608d421c7 Utilities: Update hard-coded try_compile results for libarchive 3.8.10 2026-10-28 17:53:38 -04:00
Brad King a855f0d0c4 libarchive: Set build options the way we need for CMake 2026-10-28 17:07:02 -04:00
Brad King 1acae99df2 libarchive: Add cm3p prefixes on includes new to 3.8.10 2026-10-28 17:07:02 -04:00
Brad King 0baf44d025 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2026-10-14 (0c48412b)
2026-10-28 15:28:07 -04:00
LibArchive Upstream fd7af8dc6d LibArchive 2026-10-14 (0c48412b)
Code extracted from:

    https://github.com/libarchive/libarchive.git

at commit 0c48412be2d94afe1859a807ea7896a18d8900bd (v3.8.10).
2026-10-28 15:18:11 -04:00
Brad King 5956f9d466 libarchive: Update script to get 3.8.10
Issue: #28218
2026-10-28 15:17:45 -04:00
Sergiu Deitsch 1e5e049c02 GenerateExportHeader: use C++11 attributes if available
The minimum compiler versions were determined in the GCC and LLVM
repositories as follows. The first release containing a commit is the
lowest release tag listed by ``git tag --contains <commit>``. Since a
point release of an older series can be listed although it lacks the
commit, ``git grep`` at the tag confirms the change.

1. The header requires __has_cpp_attribute to accept scoped names such
   as gnu::visibility.  The commit adding this is the oldest one whose
   diff touches a line parsing the "::" token:

     gcc$ git log --reverse --format=%H -G'CPP_SCOPE' \
            -- gcc/c-family/c-lex.c
     llvm-project$ git log --reverse --format=%H \
            -G'Ident__has_cpp_attribute.*coloncolon' -- clang/lib/Lex

   This yields 42fd12b1e7fc50183bcf62861aae81301a9efbcf in
   releases/gcc-5.1.0 and a0344c5d7b9b748a2244dce393ceb55e83b495d6 in
   llvmorg-3.6.0.

2. The GCC commit accepting mixed attribute spellings references its bug
   https://gcc.gnu.org/PR69585 in the message:

     gcc$ git log --format=%H --grep=c++/69585

   This yields aec868578d8515763d75693c1fdfbc30ff0a1e68 in
   releases/gcc-13.1.0.

Fixes: #22908
Issue: #20527
2026-10-28 20:13:16 +01:00
Alexandre Zollinger Chohfi da59d7769e cmake: Find the default generator only when printing the generator list
`cmake --version` and the other documentation options build the
generator documentation even when they do not print it.  That evaluates
the default generator, which on Windows queries the Visual Studio Setup
COM API for VS 18, 17, 16 and 15 in turn and constructs the newest
Visual Studio generator found.  It makes `cmake --version` take about
100 ms on Windows, which is a lot for a command that tools run often
to detect CMake.

Only `--help` and the generator listing print generators.  Evaluate them
only for those requests.

Fixes: #28220
2026-10-28 12:02:31 -07:00
Lee Cantey e739170f15 EMBTClang: Add support for the Embarcadero bcc64x compiler
Add a new compiler id, EMBTClang, for the Embarcadero clang-based Win64
compiler (bcc64x), as a Clang variant detected by its __CODEGEARC__ marker
on the MinGW-w64 target, and exclude that target from the Embarcadero
compiler id.

Provide Compiler/ and Platform/ modules for C, CXX, and ASM, including
feature tests, binutils discovery with the linker, resource compiler, and
LLVM binutils pinned to the toolchain, and the derived RTL and include
directories forwarded into try_compile.

Drive the WIN32_EXECUTABLE property through the toolchain's console and GUI
subsystem switches, and add an EMBT_RUNTIME_LIBRARY target property
(Static or Dynamic) implemented like WATCOM_RUNTIME_LIBRARY and
MSVC_RUNTIME_LIBRARY.

Build shared and module libraries as plain DLLs.  Search for libraries as
name.lib before the MinGW names, and do not add the GNU -Bstatic and
-Bdynamic switches.  Do not provide a C++ module dependency scanning rule:
the toolchain's clang-scan-deps does not apply the bcc64x driver's target,
standard, and include paths.

Document the new id and property, and add RunCMake and build tests covering
detection, the runtime-library property, binutils pinning, the console/GUI
subsystem macros, precompiled header reuse across target kinds, and C++20
builds without module scanning.

Closes: #26769
2026-10-28 14:58:31 -04:00
Lee Cantey f29cfe2bf9 Borland: Do not identify Clang-based Embarcadero compilers
The Borland compiler identification test matches any compiler that
defines __BORLANDC__, including the Clang-based Embarcadero compilers.
Those are identified as Embarcadero before Borland is tried, so the
result does not change, but exclude them so that the test matches only
the compilers it is meant to identify.
2026-10-28 14:58:31 -04:00
Lee Cantey 641d5321a7 Tests/Plugin: Fix symbol lookup with 64-bit Embarcadero compilers
The 32-bit Borland and Embarcadero compilers prefix C symbol names with
an underscore.  The 64-bit Embarcadero compilers also define __BORLANDC__
but do not add the prefix.
2026-10-28 14:58:31 -04:00
Lee Cantey cdfd0615b8 Tests/RunCMake/target_link_libraries-LINK_LIBRARY: Fix MinGW lld check
With ORDER=FORWARD link processing, the override-features2 check expects
the non-target library other1 with the import library prefix and suffix,
which for MinGW is libother1.dll.a.  It is linked by its name, as the
check already expects without ORDER=FORWARD.  Match it the same way.

ORDER=FORWARD is set for MSVC, whose expected pattern does not change,
and for lld with the GNU command-line frontend, as in llvm-mingw.
2026-10-28 14:58:31 -04:00
Lee Cantey ab4d0130ed Tests/BundleUtilities: Fix test with Clang-based MinGW toolchains
The test sources check WIN32, which not every Windows toolchain defines:
bcc64x defaults to a strict standard mode and does not.  Check _WIN32.

The test scripts use GetPrerequisites, which looks for objdump on the
PATH when dumpbin is not found and CMAKE_OBJDUMP is not set.  The objdump
in llvm-mingw is a shell script, and bcc64x provides only llvm-objdump.
Pass the project's CMAKE_OBJDUMP to the scripts.
2026-10-28 14:58:31 -04:00
Brad King c5986881ab Merge branch 'upstream-KWIML' into update-kwiml
# By KWIML Upstream
* upstream-KWIML:
  KWIML 2026-10-28 (b1882c31)
2026-10-28 14:55:45 -04:00
KWIML Upstream 8c775567f4 KWIML 2026-10-28 (b1882c31)
Code extracted from:

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

at commit b1882c3142ea7da6f57a0faf3ad3852fedcc0924 (master).

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

Lee Cantey (1):
      b1882c31 int.h: Enable scanf formats on Clang-based Embarcadero compilers
2026-10-28 14:55:44 -04:00
Brad King cfb3000e9e Merge branch 'release-4.5' 2026-10-28 09:59:01 -04:00
Brad King 739fe769fe CMake 4.5.0-rc2 v4.5.0-rc2 2026-10-28 09:31:47 -04:00
Brad King b3fbc49372 Merge topic 'tests-property_init-lint'
eba57196e7 Tests/RunCMake/property_init: Add lint/coverage case
29315ad49e Tests/RunCMake/property_init: Fix per-config property tests
825a52a64e Tests/RunCMake/property_init: Fix ENABLE_EXPORTS target type lists
a4d3c8b625 Tests/RunCMake/property_init: Remove duplication in PIC case
19c9125289 Tests/RunCMake/property_init: Add missing properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !12723
2026-10-28 09:28:55 -04:00
Brad King fe9b520fa3 Merge topic 'vs-avoid-non-enabled-langs'
1ec0ddf399 VS: Only generate RC options if necessary
29d594d95a VS: Only generate MIDL options if necessary
b07b27d57c VS: Only generate MASM options if necessary

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12708
2026-10-28 09:27:39 -04:00
Brad King 690bb29a4b Merge topic 'pch_optimise'
525cebab82 PCH: Add all PCH sources before computing PCH files to avoid rebuilding caches

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12633
2026-10-28 09:25:37 -04:00
Jonny Paton 525cebab82 PCH: Add all PCH sources before computing PCH files to avoid rebuilding caches
Issue: #25962
2026-10-28 09:20:10 -04:00
Brad King a62bf846ee Merge topic 'tests-tutorial-32bit'
b847bc3be0 Tests/RunCMake/Tutorial: Avoid failure on 32-bit platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Vito Gamberini <vito.gamberini@kitware.com>
Merge-request: !12666
2026-10-28 09:19:01 -04:00
Brad King 771e0a3216 Merge branch 'release-4.5' 2026-10-28 09:16:04 -04:00