Commit Graph
77250 Commits
Author SHA1 Message Date
Kitware Robot 51b2d8a2e3 CMake Nightly Date Stamp 2026-09-14 00:05:34 -04:00
Kitware Robot 5440cd9785 CMake Nightly Date Stamp 2026-09-13 00:05:59 -04:00
Kitware Robot 3f99c9ddab CMake Nightly Date Stamp 2026-09-12 00:05:23 -04:00
Brad King 216cc54531 Merge topic 'AUTOMOC-cxxmodules-support'
6280cc3df9 Autogen: Add AUTOMOC support for C++ module units
266c6f0109 Autogen: Factor out the info-file source-entry reader

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Reviewed-by: Vito Gamberini <vito.gamberini@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !12490
2026-09-11 09:16:10 -04:00
Brad King 34bbc91e3b Merge topic 'if-PATH_IS_PREFIX'
860583ceac if: Add PATH_IS_PREFIX operator
3d53f7901b Tests: Cover cmake_path(IS_PREFIX) path semantics
59a096f73b Tests: Detect a malformed genex in the PATH:IS_PREFIX test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12427
2026-09-11 09:11:02 -04:00
Brad King 0b6add1ed7 Merge topic 'refactoring-cmInstallCommand'
21cc5937c1 install(TARGETS): Factor out reusable helpers with config-specific support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12496
2026-09-11 09:01:36 -04:00
Stepanov Igor 21cc5937c1 install(TARGETS): Factor out reusable helpers with config-specific support 2026-09-11 08:50:14 -04:00
Brad King ddf5ae6a19 Merge topic 'install-code-refactor'
8997bb6431 install: Parse SCRIPT and CODE arguments with cmArgumentParser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12492
2026-09-11 08:41:07 -04:00
Brad King de0e35d84d Merge topic 'devcontainer'
f1b6b3a6f0 devcontainer: Run local customization hooks through the container's life
3cfbea10e4 devcontainer: Name the workspace path explicitly
f8f4dc7f43 gitlab-ci: add a job to verify the devcontainer in CI
ea0667e779 ci: add scripts to run and verify the devcontainer
9c17332601 devcontainer: Add `clang-tidy`, `clang-tools`, and `clazy`
a8872df649 devcontainer: Add `clang`, `gfortran`, and `valgrind`
8bd053379f devcontainer: Reword the comment on caching package downloads
7ae5c3cfb2 devcontainer: Add the Kitware APT repository
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12423
2026-09-11 08:36:11 -04:00
Brad King aa6a8702f0 Merge topic 'update-kwsys'
821f03e4d2 Merge branch 'upstream-KWSys' into update-kwsys
b8cdd8c26e KWSys 2026-09-11 (78cacab5)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12497
2026-09-11 08:31:45 -04:00
Brad King 821f03e4d2 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2026-09-11 (78cacab5)
2026-09-11 08:24:37 -04:00
KWSys Upstream b8cdd8c26e KWSys 2026-09-11 (78cacab5)
Code extracted from:

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

at commit 78cacab53201d07143cd3843df56b7708f3a7cc6 (master).

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

Tyler Yankee (1):
      edcc6bbd RegularExpression: Add newline test case
2026-09-11 08:24:37 -04:00
Brad King b2e4ccebb4 Merge topic 'ci-cuda-clang'
4261a6126f ci: run cuda13.2-clang job only in nightly pipeline

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12498
2026-09-11 08:22:01 -04:00
Kitware Robot 807b0f8841 CMake Nightly Date Stamp 2026-09-11 00:13:17 -04:00
Brad King 790aebb209 Merge topic 'doc-imported-configs'
3b34605661 Help: Describe IMPORTED_{LOCATION,IMPLIB}_<CONFIG> in more detail

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12494
2026-09-10 11:10:53 -04:00
Brad King 4261a6126f ci: run cuda13.2-clang job only in nightly pipeline
This was missed in commit 5b416cbe77 (ci: add job testing cuda13.2 with
clang, 2026-09-01).
2026-09-10 09:24:11 -04:00
Joerg Bornemann 6280cc3df9 Autogen: Add AUTOMOC support for C++ module units
Process C++ module interface and partition units that are members of a
FILE_SET of type CXX_MODULES.  moc is run on such units and its
generated output is compiled as a module implementation unit of the same
module, as its own scanned translation unit rather than folded into
mocs_compilation.cpp.  Macro-less units get an empty placeholder; module
units and their dependencies are tracked in the autogen depfile and as
byproducts for correct incremental rebuilds.

This requires Qt 6.13, whose moc supports C++ module units.  With older
Qt nothing can be generated for a module unit, so a meta-object macro
found in one is reported as an error rather than left to fail later in
the compiler or the linker.  Such a unit is no longer handled as an
ordinary source, which also means its moc include directives are not
honored and AUTOUIC does not process it.

moc rejects a meta-object macro in a module implementation unit or a
private module fragment, and AUTOMOC does not work around that.
2026-09-10 13:13:11 +02:00
Mickaël Germain 860583ceac if: Add PATH_IS_PREFIX operator
Testing whether one path is a prefix of another is possible today with
cmake_path(IS_PREFIX), but the idiom needs a separate statement plus a
scratch variable and takes the prefix as a variable name, so projects
reach for if(path MATCHES "^${prefix}") instead.  That is wrong whenever
the prefix contains a regex metacharacter, and it accepts siblings,
because '^/a/b' matches '/a/bc'.

Add a binary operator where the left operand is the candidate prefix and
the right is the path, matching the operand order of cmake_path(IS_PREFIX)
and $<PATH:IS_PREFIX> so that the same operation reads the same way on all
three surfaces.  Neither operand is normalized, matching the default of
cmake_path(IS_PREFIX) and the existing PATH_EQUAL operator, so '.' and
'..' are compared as ordinary components.  The test is non-strict, purely
lexical, and applies no relative-to-absolute reconciliation.

Add policy CMP0222 for compatibility, modeled on CMP0139.  The keyword
is consumed as an operator only when it appears in the second argument
slot, so a variable named PATH_IS_PREFIX keeps working in unary and
left-operand position.  What the policy covers is such a variable
appearing after another token, as in if(NOT PATH_IS_PREFIX AND other),
which becomes a configure error under NEW.

Since the operator is an if() spelling of cmake_path(IS_PREFIX) and shares
its implementation, test it by asserting the two agree over a corpus of
inputs rather than by restating expected values.  Those are pinned by the
cmake_path(IS_PREFIX) test, so the operator's tests stay limited to what
has no command equivalent, and no platform branching is needed because
parity holds whatever the host path model answers.

Fixes: #28040
2026-09-10 07:09:47 -04:00
Mickaël Germain 3d53f7901b Tests: Cover cmake_path(IS_PREFIX) path semantics
The IS_PREFIX test asserted four cases: duplicate separators collapsing,
a non-normalized '..' in the prefix, and two NORMALIZE cases.  None of
the rules a caller is most likely to get wrong were covered.

Add assertions for the non-strict self-prefix, trailing separators on
either operand, '.' components, the sibling-prefix trap, the absence of
relative-to-absolute reconciliation including the root directory, and
the empty path.  Add a host-path-model block covering backslashes, case
sensitivity of both ordinary components and the root-name, drive-
relative paths, and UNC root-names.
2026-09-10 07:09:39 -04:00
Kitware Robot 61a1c48686 CMake Nightly Date Stamp 2026-09-10 00:05:05 -04:00
Taylor Braun-Jones f1b6b3a6f0 devcontainer: Run local customization hooks through the container's life
The container ran a developer's own `hooks/root.sh` and `hooks/user.sh`
while the image was built, and nothing of theirs afterwards.  A
customization that has to start something, or to reach the source tree,
had nowhere to run: the tree is not mounted during the build, and the one
lifecycle command the configuration used was spoken for by the status
report.

Run an optional script per phase through `run-hooks.sh`, and offer five:
`initialize` on the host, `build` in the image, and `post-create`,
`post-start` and `post-attach` in the container.  A failing `build` hook
fails the image build, because an image whose customizations did not
apply is quietly wrong; the rest are reported and otherwise ignored, so
that a typo in a personal hook cannot leave its author unable to open the
container in order to fix it.

The two build hooks become one, running as the container user, who may
`sudo`: one hook that reaches either user is simpler to write against
than two that each reach one.  Every hook is told where it lives, and
every hook but the build one is given a directory to keep state in,
beside the hooks rather than among them because state is written by
whatever they start rather than by hand.  `.dockerignore` keeps that
directory out of the build context, which state written as `root` would
otherwise make unreadable.
2026-09-09 18:35:57 -04:00
Taylor Braun-Jones 3cfbea10e4 devcontainer: Name the workspace path explicitly
A tool that opens the container picks a workspace path of its own when
the configuration names none, and `.gitlab/ci/devcontainer-run.sh` mounts
the source tree at a path it spells itself.  The two disagreed: an editor
opened the tree at `/workspaces/cmake` while CI used the
`/home/cmake-dev/workspace` that `create_user.sh` prepares for it.  Say
which one it is, so that a path means the same thing everywhere.
2026-09-09 18:35:56 -04:00
Brad King 3b34605661 Help: Describe IMPORTED_{LOCATION,IMPLIB}_<CONFIG> in more detail
Also link to `IMPORTED_CONFIGURATIONS` and `MAP_IMPORTED_CONFIG_<CONFIG>`.

Closes: #28076
2026-09-09 14:20:22 -04:00
Brad King 20c30149e0 Merge topic 'fix-ctest-max-width'
865d6bf223 CTest: Support `--max-width` shorter than longest test name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12489
2026-09-09 13:27:11 -04:00
Brad King 4b2cf13e42 Merge topic 'findpkgconfig-l-colon'
0cc8f00e6b FindPkgConfig: support GNU ld -l:<file> exact-file syntax

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12485
2026-09-09 13:25:27 -04:00
Brad King ad9bc7bf17 Merge topic 'blas-lapack-nvpl'
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
2026-09-09 13:23:29 -04:00
Brad King c8da2e3b84 Merge topic 'help-regex-language'
7350b58c16 Help: Move regex specification to cmake-language(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12478
2026-09-09 11:59:31 -04:00
Kitware Robot 731a0e720b CMake Nightly Date Stamp 2026-09-09 00:05:31 -04:00
Ben Boeckel f8f4dc7f43 gitlab-ci: add a job to verify the devcontainer in CI 2026-09-08 16:26:08 +00:00
Ben BoeckelandTaylor Braun-Jones ea0667e779 ci: add scripts to run and verify the devcontainer
Co-authored-by: Taylor Braun-Jones <taylor@braun-jones.org>
2026-09-08 16:26:02 +00:00
Taylor Braun-Jones 9c17332601 devcontainer: Add clang-tidy, clang-tools, and clazy
Provide the analysis tools our CI images carry: `clang-tidy` to run the
checks in `.clang-tidy`, `clang-tools` for `scan-build`, and `clazy`, the
compiler our Clazy job builds with.

Name the version of `clang-tidy` our checks are written against rather
than install Ubuntu's unversioned package, which is a release behind and
reports `cmake-use-cmsys-fstream` where it should not.  `CMakeLists.txt`
searches for `clang-tidy` only under the unversioned name, so link the
version installed by name to it, as we already do for `clang-format`.

`clazy` and `clang-tools` remain whatever versions Ubuntu carries rather
than the ones the CI image does, so expect their diagnostics to differ
from those jobs'.  CMake's own clang-tidy checks are not available either
way: `CMake_USE_CLANG_TIDY_MODULE` needs `Utilities/ClangTidyModule` built
against Clang's development files, which are not installed here.

Suggested-by: Tyler Yankee <tyler.yankee@kitware.com>
2026-09-08 16:25:48 +00:00
Taylor Braun-Jones a8872df649 devcontainer: Add clang, gfortran, and valgrind
Provide `clang` for developers who prefer to build with it rather than
with the default `g++`, and `valgrind` to run CMake and its tests under a
memory checker.  The sanitizer runtimes already come with both
compilers, so building with `-fsanitize=` needs nothing installed.

Name `gfortran` as well, without which Clang cannot link at all.  Ubuntu
26.04 carries a Fortran-only `gcc-16` build that provides no C++ standard
library, `libopenmpi-dev` lists `gfortran-16` first among the
alternatives it accepts, and Clang selects the newest GCC installation it
finds.  Naming `gfortran` lets `apt` satisfy that dependency with
`gfortran-15` instead, so the GCC 16 installation never appears.

Suggested-by: Tyler Yankee <tyler.yankee@kitware.com>
2026-09-08 16:25:11 +00:00
Taylor Braun-Jones 8bd053379f devcontainer: Reword the comment on caching package downloads
The sentence packed the two purposes of the mounts and their effect into
one clause chain, which was hard to follow.  Split it in two.

Suggested-by: Tyler Yankee <tyler.yankee@kitware.com>
2026-09-08 16:25:05 +00:00
Taylor Braun-Jones 7ae5c3cfb2 devcontainer: Add the Kitware APT repository
Configure `apt.kitware.com` in the development container so that `cmake`
is the latest CMake release rather than the older one Ubuntu carries, and
so that developers reach each further release through `apt-get` alone.

Fetch the repository's signing key, verified against the hash the
`Dockerfile` pins, and trust it just long enough to install
`kitware-archive-keyring`, which then provides the key, so that `apt`
follows the rotations Kitware makes to it.  Interpolating the hash into
the step that fetches the key also busts the build cache when the hash
changes, so a rotation is picked up rather than served from an old layer.
Reaching either the key or the repository needs `curl` and a certificate
store, neither of which the base image carries, so install them first.
2026-09-08 16:24:41 +00:00
Taylor Braun-Jones 69c15636b6 devcontainer: Add the GitLab CLI and glab-axi
Install `glab`, the GitLab CLI, and `glab-axi`, an agent-ergonomic
wrapper around it, in the development container.

Default `GITLAB_HOST` to `gitlab.kitware.com` so that both address our
GitLab instance without further configuration, persist the `glab`
configuration directory on a volume so that a credential need be created
only once, and pass a `GITLAB_TOKEN` or `GITLAB_CLIENT_ID` from the host
through to the container.

Neither tool can authenticate on its own, so check for a working
credential each time a tool attaches to the container and print what
remains to be set up if there is none.
2026-09-08 16:23:53 +00:00
Taylor Braun-Jones d326c8afd5 devcontainer: Add a Dev Container definition for CMake development
Provide a `.devcontainer` definition, following the Dev Container
Specification, to give contributors a ready-made Linux environment with
the tools needed to build CMake, run its test suite, build its
documentation, and satisfy its style rules.

Base the container on Ubuntu, which offers the broadest ecosystem of
packages and tooling for development, including a recent `cmake` and the
`clang-format` version our style rules require, exactly.  Mirror the
package lists of the Debian image our CI infrastructure uses, section by
section, so that the dependencies available closely match the ones
against which merge requests are tested.  Build the image the way the
images under `.gitlab/ci/docker/` are built: bind mount the package
lists and the installation script rather than copying them in, and cache
the package lists and downloaded archives so that a rebuild fetches only
what has changed.

Run optional `.devcontainer/hooks/root.sh` and
`.devcontainer/hooks/user.sh` scripts, both ignored by Git, so that
developers may customize the container without modifying tracked files.

Document usage in a new `Help/dev/devcontainer.rst`.

Fixes: #28043
2026-09-08 16:23:33 +00:00
Brad King 2d27955337 Merge topic 'help-command-anon-hyperlink'
119b2e62f8 cmRST: match anonymous hyperlink syntax
9ed206876f testRST: add test cases for anonymous hyperlinks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12482
2026-09-08 10:00:41 -04:00
Brad King 03aad08cfd Merge topic 'doc-system-name-script-mode-link'
5da34d2f45 Help: link CMAKE_SYSTEM_NAME script-mode note to CMAKE_HOST_SYSTEM_NAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12488
2026-09-08 09:58:18 -04:00
Brad King 171d3120de Merge topic 'doc-blas-lapack-libraries'
b2feea6f38 Find{BLAS,LAPACK}: Document intended usage of `_LIBRARIES` more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12491
2026-09-08 09:57:18 -04:00
Brad King 9f69b22d30 Merge topic 'FindBLAS-mkl-fortran'
7fc5446d66 FindBLAS: Fix MKL Fortran API selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12479
2026-09-08 09:55:59 -04:00
Brad King fd80f621a5 Merge topic 'FindBLAS-mkl-threading'
f49e24f150 FindBLAS: Select MKL threading layer based on the OpenMP runtime library
e4a3ef7f8b FindBLAS: Select Intel MKL Fortran ABI and threading runtime independently

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12480
2026-09-08 09:51:21 -04:00
Kitware Robot cfccbd4093 CMake Nightly Date Stamp 2026-09-08 00:05:32 -04:00
Mickaël Germain 59a096f73b Tests: Detect a malformed genex in the PATH:IS_PREFIX test
The final assertion opened a generator expression and never closed it.
file(GENERATE) passes such a string through verbatim rather than
diagnosing it, and the result is a non-empty string, so an assertion
that tests only for truth cannot fail.  That case has been vacuous
since it was added.

Close the expression, and compare each result against the exact value
the operation returns rather than against its truthiness, so that a
malformed expression is reported instead of quietly satisfying the
check.
2026-09-07 20:29:29 -07:00
Ye Luo d8ade0500e Find{BLAS,LAPACK}: Provide full paths in {BLAS,LAPACK}_LIBRARIES with NVPL
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
2026-09-07 12:37:49 -04:00
Ye Luo cdf4234bc4 Find{BLAS,LAPACK}: Only search for the needed components of NVPL 2026-09-07 12:37:49 -04:00
Nerixyz 865d6bf223 CTest: Support --max-width shorter than longest test name
Fixes: #24101
2026-09-07 18:21:35 +02:00
15daksh-2003 0cc8f00e6b FindPkgConfig: support GNU ld -l:<file> exact-file syntax
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
2026-09-07 21:28:11 +05:30
Brad King b2feea6f38 Find{BLAS,LAPACK}: Document intended usage of _LIBRARIES more precisely
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
2026-09-07 11:20:04 -04:00
Ye Luo f49e24f150 FindBLAS: Select MKL threading layer based on the OpenMP runtime library
Fixes: #28072
2026-09-07 10:39:21 -04:00
Ye Luo 7fc5446d66 FindBLAS: Fix MKL Fortran API selection
Fixes: #28071
2026-09-07 10:35:54 -04:00