16 Commits
Author SHA1 Message Date
Brad King 111454d8e0 Merge topic 'cmake-diagnostics-state'
99318e49b9 Help: Mention when diagnostics were added
daec98ba61 Diagnostics: Fix passing diagnostic state to try_compile
e0b0ac4295 Diagnostics: Overhaul warnings in cmake-gui
ca5d569524 Diagnostics: Switch state to new system
618c074a8c Diagnostics: Use categories for presets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11855
2026-04-15 10:29:06 -04:00
Matthew Woehlke 618c074a8c Diagnostics: Use categories for presets
Modify diagnostics to track which preset schema version corresponds to
the introduction of each diagnostic. Modify how we parse presets to use
the set of diagnostics to generate bindings, and to store diagnostics as
maps rather than as fixed members. Enforce that only diagnostics known
to the specified preset version are present.

This is a first and necessary step toward moving CMake's internals over
to flexible categories rather than each category having its own bespoke
variables and member functions.

Note that the presets documentation currently contains some broken
links, as it is anticipating further documentation updates that will
happen in a future commit.
2026-04-13 10:41:18 -04:00
Alex Turbov 37853f25b7 cmCMakePresetsGraph: class -> typename in template declarations 2026-04-11 20:57:16 +04:00
Tyler Yankee 3c314349d5 presets: Evaluate fileDir macro ahead of schedule
Introduce a mechanism for "immediate" evaluation of preset macros as
they are defined in the current JSON file, rather than deferring until
after the preset graph is merged. This allows `${fileDir}` to always
be expanded with the path to the directory containing the file which
contains the macro, instead of the path being dependent on the preset
in which the macro is used (which could be defined and inherited from
elsewhere).

Bump to presets version 12 to provide backwards compatibility with the
old behavior.

Fixes: #26982
Relates: #27329, #27639
2026-03-17 08:16:50 -04:00
Tyler Yankee 71ff5a9d6f presets: Disallow negative values for "jobs" fields
Jobs should never be negative, to mirror the behavior on the command
line for both `cmake --build` and `ctest`. This fixes unintended
behaviors where "-1" would lead to `cmake::NO_BUILD_PARALLEL_LEVEL`
being used for build presets and an integer overflow occurring for test
presets.

Bump to presets version 11 to signify the change.
2026-01-29 16:25:07 -05:00
Kitware Robot 1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot 0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Cristian Le 741a207717 presets: Refactor macro expander implementation
Change the macro expander to use vtable dispatch.

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2024-02-16 07:50:01 -05:00
ChenMoFeiJin f1a7179520 presets: Add $schema property to JSON schema
Many modern code editors have support for JSON Schema.  When you specify
the `$schema` property in a JSON file, the editor can provide features
like auto-completion, error checking, etc., which can improve your
efficiency when writing and modifying the `CMakePresets.json` file.
2023-09-12 18:18:37 +08:00
Zoran Angelov f552ba6e6d presets: add support for macro expansion to includes
Only `$penv{}` can be expanded when processing includes.
2023-04-26 10:03:53 -04:00
Martin Duffy 19305afd8a presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -04:00
Kyle Edwards 91a7c0b51c CMake: fix violations of #pragma once check 2022-11-17 13:55:52 -05:00
Kyle Edwards e316812884 CMakePresets.json: Add workflow presets to schema 2022-09-26 10:53:28 -04:00
Kyle Edwards b699610df4 cmCMakePresetsGraph: Add package presets 2022-08-31 10:18:01 -04:00
Kyle Edwards 84d440caac Refactor: Split JSON processing into configure, build, and test presets
Split up the file so that it won't be too big on some systems.
2022-01-06 18:52:30 -05:00
Kyle Edwards fd6ea2f67f Refactor: Rename cmCMakePresetsFile to cmCMakePresetsGraph
And change all references to "file" to say "graph" instead.
2022-01-06 18:52:30 -05:00