| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`. Use `clang-format` version 6.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones. For example:
#include <cm/string_view>
can be used safely for CMake development in place of the `<string_view>`
standard header.
Fixes: #19491
|
|
|
|
|
| |
Replace string construction using std::stringstream with cmStrCat and
cmWrap.
|
| |
|
|
|
|
|
|
| |
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators. Leave new expressions and cast
expressions for later.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is generated by a python script that uses regular expressions to
search for string concatenation patterns of the kind
```
std::string str = <ARG0>;
str += <ARG1>;
str += <ARG2>;
...
```
and replaces them with a single `cmStrCat` call
```
std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...);
```
If any `<ARGX>` is itself a concatenated string of the kind
```
a + b + c + ...;
```
then `<ARGX>` is split into multiple arguments for the `cmStrCat` call.
If there's a sequence of literals in the `<ARGX>`, then all literals in the
sequence are concatenated and merged into a single literal argument for
the `cmStrCat` call.
Single character strings are converted to single char arguments for
the `cmStrCat` call.
`std::to_string(...)` wrappings are removed from `cmStrCat` arguments,
because it supports numeric types as well as string types.
`arg.substr(x)` arguments to `cmStrCat` are replaced with
`cm::string_view(arg).substr(x)`
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
da26b3be89 avoid adding multiple consecutive string literals to std::string
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3698
|
| |
| |
| |
| | |
While at it change some single character additions to be of type char.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
f1c529c4fb cmCryptoHash: Accept cm::string_view input
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3697
|
| |/ |
|
|/
|
|
|
|
|
|
|
| |
This replaces invocations of
- `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn`
- `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND`
- `cmSystemTools::IsOn` with `cmIsOn`
- `cmSystemTools::IsOff` with `cmIsOff`
|
|\
| |
| |
| |
| |
| |
| | |
935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3681
|
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the following functions to cmStringAlgorithms:
- `cmStrToLong`: moved from `cmSystemTools::StringToLong`
- `cmStrToULong`: moved from `cmSystemTools::StringToULong`
Overloads of the given functions for `std::string` are added as well.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
6bc77966ad Retry removing directories on Windows
5729580376 Use registry setting for removal retry count and delay
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3667
|
| | |
| | |
| | |
| | |
| | |
| | | |
On Windows removing a directory can fail if other processes have a
handle to it. This has been "solved" with a retry hack when moving
directories, so use the same hack when removing directories.
|
| |/
|/| |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
| |
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
|
|\
| |
| |
| |
| |
| |
| |
| | |
bd2793b6e9 Help: Add documentation for INSTALL_REMOVE_ENVIROMENT_RPATH
f08dcbffec Property: Add INSTALL_REMOVE_ENVIROMENT_RPATH property
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3544
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value
argument instead of a `const char *`.
Benefits are:
- `std::string` can be passed to `cmMakefile::AddDefinition` directly without
the `c_str()` plus string length recomputation fallback.
- Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at
compile time.
In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid
`std::string::c_str` calls and the `std::string` is passed directly.
Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might
be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
|
| |
|
|
|
|
|
|
|
|
| |
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints. Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
|
|
|
|
| |
Co-Authored-by: Bryon Bean <bryon.bean@kitware.com>
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
5b53cfda24 cmSystemTools: Remove cmSystemToolsFileTime interface
9c576a88d9 Use cmFileTimes instead of cmSystemToolsFileTime interface
4b45a5d5c7 cmFileTimes: New RAII based cmFileTimes class
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3358
|
| | |
|
|\ \
| |/
|/|
| |
| |
| |
| | |
a1eb03569d file: Change REMOVE to ignore empty names
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3349
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously code like
file(REMOVE_RECURSE "${accidentally_missing_variable}")
treated the empty string as a relative path with respect to the
current directory and removed its contents. Change this behavior
to ignore the empty string with a warning instead.
Normally such behavior changes are done with a policy, but in this case
such code is likely a real bug in project code that can delete data.
Fixes: #19274
|
|/ |
|
| |
|
|
|
|
| |
Split these classes out into their own sources.
|
|
|
|
|
|
| |
Make use of cmJoin and fresh cmRange::transform
to reduce function complexity.
Move conversion logic to named functions.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
ae5e97a005 Delete some default constructors and assignment operators
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2968
|
| |
| |
| |
| |
| |
| | |
They are unused, but if someone used them they would lead to
problems since they would copy the internal raw pointers
and the destructor would cause double delete
|
|/ |
|
|\
| |
| |
| |
| |
| |
| | |
080a79ca4a cmSystemTools: More methods accept `std::string` params
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2952
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
Replaced most manual `const_iterator`-based loops and some
reverse-iterator loops with range loops.
Fixes: #18858
|
|
|
|
| |
Changed for sequenced containers: vector, list, string and array
|
|\
| |
| |
| |
| |
| |
| | |
c31b6e616d cmSystemTools: copy file member functions accept std::string params
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2877
|
| |
| |
| |
| |
| | |
Cleaned up `c_str()`s.
`cmSystemTools::CopyFileIfDifferent()` removed as redundant.
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| | |
094f01d0f0 cleanup: Prefer compiler provided special member functions
55671b41d2 clang-tidy: Use `= default`
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !2841
|