summaryrefslogtreecommitdiffstats
path: root/Source/cmListCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* clang-tidy: fix `performance-unnecessary-copy-initialization` lintsBen Boeckel2022-05-241-4/+4
|
* clang-tidy: address `google-readability-casting` lintsBen Boeckel2022-05-241-5/+6
| | | | At least those involving `static_cast`.
* cmListCommand: Handle invalid FOR selector rangesNick Muggio2021-12-091-2/+11
| | | | | | | | | Fixes crashes involving invalid ranges specified in list(TRANSFORM ... FOR ...) calls. * Report error when step is not positive * Report error when start is after stop Fixes: #22985
* Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-1/+1
|
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-1/+1
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* Source: Reduce c_str() usagevvs314152021-03-131-6/+6
|
* cmListCommand: add a policy for failing on invalid indiciesBen Boeckel2021-02-181-7/+30
|
* cmListCommand: prefer strtol to atoiBen Boeckel2021-02-181-4/+8
| | | | This allows for detecting errors.
* cmListCommand: refactor out index argument parsingBen Boeckel2021-02-161-5/+32
| | | | This is in preparation for detecting errors in index argument syntax.
* list(REMOVE_ITEM): Make removal of an empty item a no-op.Asit Dhal2021-01-121-3/+4
| | | | Fixes: #21663
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-12/+13
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+3
|
* Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-301-2/+1
|
* Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-1/+2
|
* list: add NATURAL sorting on SORT sub-commandJohnny Jazeix2020-04-131-2/+21
| | | | Fixes: #20563
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | 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.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+2
| | | | | | | | | | | | | | 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
* Refactor: Use cmStrCat to construct error stringsAsit Dhal2019-09-181-69/+42
| | | | | Replace string construction using std::stringstream with cmStrCat and cmWrap.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-3/+3
|
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-18/+14
| | | | | | 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.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-1/+1
|
* IWYU: Add missing cstddef includes for size_t and nullptr_tBrad King2019-09-031-0/+1
| | | | The IWYU tool we use for CI now diagnoses these.
* Merge topic 'source_sweep_ostringstream_single'Brad King2019-08-261-3/+3
|\ | | | | | | | | | | | | 3b2b02825d Source sweep: Replace std::ostringstream when used with a single append Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3726
| * Source sweep: Replace std::ostringstream when used with a single appendSebastian Holtermann2019-08-231-3/+3
| | | | | | | | | | | | | | This replaces `std::ostringstream`, when it is written to only once. If the single written argument was numeric, `std::to_string` is used instead. Otherwise, the single written argument is used directly instead of the `std::ostringstream::str()` invocation.
* | Merge topic 'list-subcommand-table'Brad King2019-08-261-111/+43
|\ \ | |/ |/| | | | | | | | | b14bcd9123 cmListCommand: Use cmSubcommandTable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3723
| * cmListCommand: Use cmSubcommandTableRegina Pfeifer2019-08-221-111/+43
| |
* | Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-8/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* Merge topic 'cmCommand_refactor'Brad King2019-08-221-175/+240
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6ab28b9413 cmCommand refactor: cmStringCommand 36f32d3604 cmCommand refactor: cmSetPropertyCommand 7c83c19205 cmCommand refactor: cmSetDirectoryPropertiesCommand 9413952c42 cmCommand refactor: cmCMakePolicyCommand 07ea93de54 cmCommand refactor: cmWriteFileCommand ca3b9186bb cmCommand refactor: cmVariableWatchCommand b1acc711f4 cmCommand refactor: cmRemoveCommand 413a960391 cmCommand refactor: cmCMakeHostSystemInformationCommand ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3673
| * cmCommand refactor: cmListCommandGabor Bencze2019-08-201-175/+240
| |
* | Merge topic 'isolate-declarations'Brad King2019-08-221-4/+9
|\ \ | | | | | | | | | | | | | | | | | | d331021255 clang-tidy: isolate declarations for readability Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3704
| * | clang-tidy: isolate declarations for readabilityRegina Pfeifer2019-08-201-4/+9
| |/
* | cmAlgorithms: Add cmContainsRegina Pfeifer2019-08-191-1/+1
|/ | | | Also, use the new function where applicable.
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-3/+3
|
* Merge topic 'tidy_inefficient_string'Brad King2019-08-071-28/+23
|\ | | | | | | | | | | | | 18b0330b86 clang-tidy: Enable performance-inefficient-string-concatenation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3648
| * clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-28/+23
| | | | | | | | | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* | cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenizeSebastian Holtermann2019-08-051-1/+1
|/ | | | | | | | | | This adds the following functions to `cmStringAlgorithms`: - `cmIsSpace` - `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`) - `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`) - `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to accept `cm::string_view`)
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-20/+18
| | | | | | | | | | | | | | | | 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.
* Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-1/+2
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-0/+2
| | | | | | | | 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.
* list(POP_FRONT): Fix always assigning first item to output varsAlex Turbov2019-06-301-1/+1
| | | | Fixes: #19436
* Merge topic 'cmrange-improvements'Brad King2019-02-251-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | b8031308f3 cmRange: Add unit tests a8d51ef8b7 cmRange: Add functions filter and transform da4773e8b8 cmRange: Add functions all_of, any_of, none_of 17a367e77f cmRange: Stylistic cleanup 9eb0e73f46 cmRange: Move to dedicated header file Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Artur Ryt <artur.ryt@gmail.com> Merge-request: !2972
| * cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-0/+1
| |
* | list: add sub-commands PREPEND, POP_BACK, POP_FRONTAlex Turbov2019-02-191-4/+134
|/
* Merge topic 'tidy-use-equals-default'Brad King2019-01-291-2/+2
|\ | | | | | | | | | | | | | | | | 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
| * clang-tidy: Use `= default`Regina Pfeifer2019-01-251-2/+2
| | | | | | | | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* | cmListCommand: Avoid std::function move constructor on aarch64Brad King2019-01-241-0/+5
|/ | | | | | | | Since commit 5a0784ddea (clang-tidy: Pass by value, 2019-01-21), some of the `RunCMake.{list,PositionIndependentCode}` cases have crashed on an aarch64 build with GCC 6. Avoiding use of the `std::function` move constructor avoids the crash. Use a strict preprocessor condition to use this workaround only where needed.
* clang-tidy: Pass by valueRegina Pfeifer2019-01-221-6/+5
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-3/+3
| | | | Reduce the number of files relying on `cmake.h`.