Commit Graph

20 Commits

Author SHA1 Message Date
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
Alex Turbov
0c17cc9ef5
cmJSONHelpers.h: Add FilteredObject helper
Iterate over the object's members and call a filter callable to decide what
to do with the current key/value. A filter returns one of the `FilterResult`
values. A container type is an associative or a sequence container of pairs
(key, value).

Refactor `MapFilter()` and `Map()` to use `FilteredObject()`. Moreover,
for C++ >= 17 implementation is more optimized depending on the given filter
object type and capable of detecting and properly calling the filter callable
using 1 or 3 arguments, up to totally eliminate any checking (even dummy)
in the generated code.

Supported container types, used to append key/value items, aren't limited to
`std::map` only and can be any associative container or a sequenced one with
pairs of key/value as elements.
2024-08-26 19:01:48 +04:00
Alex Turbov
17de44e99b
cmJSONHelpers.h: Add some empty lines to split code blocks 2024-08-15 22:01:34 +04:00
Alex Turbov
0b334e5bfb
cmJSONHelpers.h: Add generic predicate checking helper
And use it in the `cmCMakePresetsGraphReadJSON.cxx` to check
presets schema version in the declarative way.

Co-authored-by: Martin Duffy <martin.duffy@kitware.com>
2024-08-15 22:01:34 +04:00
Alex Turbov
503a73b183 cmJSONHelpers.h: Use map::emplace() instead of operator[] 2024-08-14 01:37:38 +04:00
Alex Turbov
e7dcd51a61 cmJSONHelpers.h: Remove useless cmStrCat() call 2024-08-14 01:37:38 +04:00
Alex Turbov
5096ea7a92 cmJSONHelpers.h: Optimize of adding Members to a vector 2024-08-14 01:37:38 +04:00
Alex Turbov
f4a2070731 cmJSONHelpers.h: Remove redundant ; 2024-08-14 01:16:40 +04:00
Alex Turbov
23be530275 cmJSONHelpers.h: Move variable declaation close to first usage 2024-08-14 01:16:34 +04:00
Aliaksandr Averchanka
7d2cc6ece6 presets: Allow comments in presets files
Co-authored-by: Kanaiym <abdigak@clarkson.edu>
Fixes: #22791
2024-06-24 15:42:46 -04:00
Kyle Edwards
94241e243d cmJSONHelpers: Make error generators proper functions 2023-08-16 09:56:48 -04:00
Kyle Edwards
93ed53790c bootstrap: Unconditionally build libjsoncpp 2023-07-26 10:07:38 -04:00
Martin Duffy
19305afd8a presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -04:00
Kitware Robot
33abef7416 Revise C++ coding style using clang-format-15
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 15.

* 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.

Fixes: #24315
2023-01-18 16:20:47 -05:00
Martin Duffy
7b7fc2df0b cmJSONHelpers: Allow passing state context
Allow for passing of context to JSON Helper methods in cmJSONHelpers.
2022-05-05 12:12:53 -04:00
Martin Duffy
30336dab66 cmJSONHelpers: Restructure cmJSONHelpers
Restructure cmJSONHelpers to prevent SunPro errors when passing context.
2022-05-05 12:12:12 -04:00
Kyle Edwards
8bc5c8961e CMakePresets.json: Add the ability to conditionally disable presets 2021-03-22 15:04:54 -04:00
Kyle Edwards
3059e6aed7 cmJSONHelpers: Add new Bind() function 2020-10-05 09:49:59 -04:00
Kyle Edwards
3f3a30e1e0 JSON: Add helpers 2020-09-09 08:29:02 -04:00