Sebastian Holtermann
9b334397f5
Source sweep: Use cmStrCat for string concatenation
...
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)`
2019-08-22 16:38:10 +02:00
Brad King
337be1507d
Merge topic 'isolate-declarations'
...
d331021255 clang-tidy: isolate declarations for readability
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3704
2019-08-22 10:23:34 -04:00
Brad King
bfe0ea2d98
Merge topic 'cm-contains'
...
2dfc52675c cmAlgorithms: Add cmContains
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@web.de>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !3700
2019-08-21 11:52:06 -04:00
Regina Pfeifer
d331021255
clang-tidy: isolate declarations for readability
2019-08-21 00:20:49 +02:00
Brad King
a0c8405d68
Merge topic 'trace-redirect'
...
3c94069660 Add --trace-redirect parameter to redirect trace output to a file
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3645
2019-08-20 09:20:49 -04:00
Regina Pfeifer
2dfc52675c
cmAlgorithms: Add cmContains
...
Also, use the new function where applicable.
2019-08-19 20:01:39 +02:00
Sebastian Holtermann
20e580be01
Source sweep: Use cmIsOn instead of cmSystemTools::IsOn
...
This replaces invocations of
- `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn`
- `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND`
- `cmSystemTools::IsOn` with `cmIsOn`
- `cmSystemTools::IsOff` with `cmIsOff`
2019-08-17 12:14:14 +02:00
Sebastian Holtermann
f4f3c68926
Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument
2019-08-14 16:33:20 +02:00
Kyle Edwards
9ab15fa74a
Merge topic 'cmRemoveQuotes'
...
27090096ef cmStringAlgorithms: Add cmRemoveQuotes
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3665
2019-08-13 09:52:23 -04:00
Igor Ivanov
3c94069660
Add --trace-redirect parameter to redirect trace output to a file
2019-08-10 11:41:53 +03:00
Kitware Robot
54e9d38c28
Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAP
2019-08-09 10:41:44 -04:00
Sebastian Holtermann
27090096ef
cmStringAlgorithms: Add cmRemoveQuotes
...
- Add `cmRemoveQuotes` function to cmStringAlgorithms
- Remove unused removeQuotes inline functions
2019-08-09 12:20:50 +02:00
Sebastian Holtermann
18b0330b86
clang-tidy: Enable performance-inefficient-string-concatenation
...
Enables the clang-tidy test performance-inefficient-string-concatenation
and replaces all inefficient string concatenations with `cmStrCat`.
Closes : #19555
2019-08-05 17:21:00 +02:00
Sebastian Holtermann
0962589627
cmake: Initialize booleans at declaration and cleanup constructor
2019-08-03 11:44:38 +02:00
Sebastian Holtermann
a693e875db
Cleanups: Use cmHas{Prefix,Suffix} instead of String{Starts,Ends}With
2019-08-01 13:33:00 +02:00
Brad King
1672d3d5a5
Merge topic 'clang-tidy-8'
...
4af094c8df clang-tidy: Blacklist violations for version 8
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3627
2019-07-31 11:54:28 -04:00
Regina Pfeifer
4af094c8df
clang-tidy: Blacklist violations for version 8
...
Check the codebase with clang-tidy version 8, fix the low hanging
fruits, blacklist the rest.
2019-07-30 12:38:30 +02:00
Sebastian Holtermann
f71f7ce3f0
cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.h
...
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
2019-07-29 21:13:56 +02:00
Marc Chevrier
d9b2c7dae2
Introduce memory management helper: cm_memory.hxx
2019-07-14 15:37:30 +02:00
Brad King
71fbebd1dc
IWYU: Fix handling of <memory> standard header
...
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.
2019-07-10 11:48:56 -04:00
Sebastian Holtermann
e50fa44a35
cmake: Refactor file extension list setup
...
Refactor the file extention list setup in cmake.h/cxx and add file extensions
lists for Cuda and Fortran.
2019-07-04 13:46:15 +02:00
Alex Turbov
5e52de7d57
modermize: replace some raw pointers w/ unique_ptr
2019-06-24 09:36:09 -04:00
Brad King
c932f49842
cmake: Teach -E capabilities to report supported fileapi requests
...
Fixes : #19339
2019-06-07 11:08:38 -04:00
Brad King
6696855f72
cmake: Simplify implementation of -E capabilities
...
The `cmake -E capabilities` command-line tool is implemented only in a
full-featured (non-bootstrap) CMake, and server mode is now always
available in this case.
2019-06-07 11:08:38 -04:00
Sebastian Holtermann
006229278b
Use cmAppend to append ranges to std::vector instances
2019-05-23 16:19:49 +02:00
Brad King
8ed6efbbd3
Merge topic 'default-generator-env'
...
d0f0ba0f7a Tests: Add environment generator tests
a48ce8f4bf Help: Add documentation for default generator environment variables
083cf7e8a2 cmake: Allow default generator to be set by environment variables
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3218
2019-05-22 10:32:43 -04:00
Vitaly Stakhovsky
273257222e
Source: change parameters to std::string
2019-05-19 10:33:26 -04:00
Eicke Herbertz
083cf7e8a2
cmake: Allow default generator to be set by environment variables
...
When there is no Generator available in the Cache, this will read
CMAKE_GENERATOR from environment before using the CMake platform default.
If CMAKE_GENERATOR is empty, use the platform default.
If a environment default generator is specified, subsequent variables
CMAKE_GENERATOR_(INSTANCE,PLATFORM,TOOLSET) are also evaluated
in the same way.
2019-05-16 23:00:27 +02:00
Kyle Edwards
8cc04b1918
cmake: Display error if generate step fails
2019-05-13 10:31:39 -04:00
Alex Turbov
6cc93b370e
message(): Add support for log levels
...
Relates: #18943
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2019-04-28 22:45:44 +10:00
Alex Turbov
99698ee351
cmake: Fix missed return
statement when CLI errors found
2019-04-01 08:31:25 +11:00
Brad King
89abbdd8c8
Merge topic 'ghs-linux'
...
2c43fb5be3 FindThreads: Fix pthread library check in GHS Multi Generator
0404efe786 GHS: Add support for GHS Multi Generator in Linux
2060a1445c Tests: Fix file name case in GHS object library test
ddad70c8a4 Tests: Run GHS tests in a separate ctest process
f7dca1fc97 GHS: Fix include-what-you-use and clang-tidy diagnostics
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3006
2019-03-22 09:22:44 -04:00
Naren Manimohan
0404efe786
GHS: Add support for GHS Multi Generator in Linux
2019-03-21 12:57:40 -04:00
Sebastian Holtermann
ec3c968de2
cmake: Use scopes to limit temporary object lifetime
2019-03-18 15:09:11 +01:00
Sebastian Holtermann
5536cec46e
Rename cmFileTimeCache::FileTimeCompare to cmFileTimeCache::Compare
2019-03-18 15:09:11 +01:00
Sebastian Holtermann
a6d75a1ce0
Substitute FileComparison in variable names with FileTimeCache
2019-03-18 15:09:11 +01:00
Sebastian Holtermann
216416219a
Rename cmFileTimeComparison to cmFileTimeCache
...
The name `cmFileTimeCache` reflects the functionality of the class more
appropriately.
2019-03-18 15:09:11 +01:00
Brad King
83183cbaec
Merge topic 'vs-no-stamp-messages'
...
67428e9025 VS: Do not print message when generate.stamp is up-to-date.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3054
2019-03-06 08:37:14 -05:00
Olli Kallioinen
67428e9025
VS: Do not print message when generate.stamp is up-to-date.
...
Fixes : #16783
2019-03-05 11:20:42 -05:00
Bartosz Kosiorek
324d18bb34
cmake: Teach --build mode to support multiple targets
...
Fixes : #16136
2019-03-05 08:55:28 -05:00
Vitaly Stakhovsky
9dd255548d
cmSystemTools::Error: consolidate parameters into single std::string
2019-02-20 11:18:11 -05:00
Brad King
2bff8513f2
Merge topic 'modernize-for-loops-c-arrays'
...
706b93fa55 Modernize: C-arrays and loops over them
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2951
2019-02-19 07:56:41 -05:00
Artur Ryt
706b93fa55
Modernize: C-arrays and loops over them
...
It replaces C arrays with deduced std::initializer_lists
or std::array what makes enables for-loop over them.
2019-02-15 23:40:30 +01:00
Vitaly Stakhovsky
bd20cc29a2
cmSystemTools: Remove redundant cmCopyFile() and Split()
2019-02-15 09:52:29 -05:00
Brad King
8914d4317a
Merge topic 'systools-stdstring2'
...
080a79ca4a cmSystemTools: More methods accept `std::string` params
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2952
2019-02-13 10:17:08 -05:00
Vitaly Stakhovsky
080a79ca4a
cmSystemTools: More methods accept std::string
params
2019-02-11 18:11:59 -05:00
Vitaly Stakhovsky
950c099d83
cmake: Progress functions use std::string
param
2019-02-11 10:32:43 -05:00
Vitaly Stakhovsky
0779bc9393
ReadListFile: Accept std::string argument
2019-01-31 09:27:54 -05:00
Brad King
c30f9b1cde
Merge topic 'functional-callbacks'
...
8c92db829b MessageCallback: Remove unused bool& argument
bcee24aecc Use `std::function` for callbacks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: vvs31415 <vstakhovsky@fastmail.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !2872
2019-01-30 08:10:27 -05:00
Vitaly Stakhovsky
c31b6e616d
cmSystemTools: copy file member functions accept std::string params
...
Cleaned up `c_str()`s.
`cmSystemTools::CopyFileIfDifferent()` removed as redundant.
2019-01-29 10:34:18 -05:00