Commit Graph

423 Commits

Author SHA1 Message Date
Ben Boeckel
a0610cf9e9 clang-tidy: fix bugprone-signed-char-misuse warnings 2021-01-27 08:45:44 -05:00
Ben Boeckel
c826461d9c clang-tidy: fix bugprone-reserved-identifier warnings 2021-01-27 08:45:44 -05:00
Asit Dhal
c3385dd8bd file(GENERATE): Support options to manipulate file permissions
Fixes: #15653
2020-12-21 12:16:16 +01:00
Asit Dhal
6d0712c225 file(configure): Order of named options should be specified in any order
Fixes: #20915
2020-12-13 09:45:11 +01:00
Brad King
b824fd5a2e Merge topic 'file-configure-angle-brackets'
06a9a3bdc3 file(CONFIGURE): Allow angle brackets in content

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5379
2020-10-16 09:23:42 -04:00
Cristian Adam
06a9a3bdc3 file(CONFIGURE): Allow angle brackets in content
Fixes: #21306
2020-10-15 15:42:21 +02:00
Asit Dhal
2713a4fb37 file(GENERATE): Refactor options handling 2020-10-12 09:26:57 +02:00
Asit Dhal
195d14e781 file(ARCHIVE_CREATE): Add option to control compression level
Fixes: #21125
2020-09-21 13:08:11 -04:00
Marc Chevrier
be36266dab file(): Add REAL_PATH sub-command 2020-09-08 18:33:57 +02:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Sibi Siddharthan
7de60beddf file: Add CHMOD and CHMOD_RECURSE subcommands
Fixes: #21057

Signed-off-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
2020-08-26 21:22:50 +05:30
Raul Tambre
27a912193b file(GENERATE): Add TARGET argument
Adds TARGET argument to file(GENERATE) to make resolving generator expressions
requiring a target possible.

Implements #21101, fixes #21074.
2020-08-20 17:41:52 +03:00
Felix Yan
5dd710286f Correct a typo in cmFileCommand.cxx 2020-08-06 10:25:51 -04:00
Kyle Edwards
fed7d8f76d file(DOWNLOAD): Make file argument optional 2020-07-27 11:26:50 -04:00
Brad King
9c3e9881ef Merge topic 'file-ARCHIVE-files-dirs'
bbcff21f71 file(ARCHIVE*): Collapse FILES and DIRECTORY options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4955
2020-07-01 07:00:42 -04:00
Brad King
947a518716 Merge topic 'file-CONFIGURE-subdir'
e5f5eeca2f file: Fix CONFIGURE output relative path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4951
2020-06-30 08:04:07 -04:00
Craig Scott
bbcff21f71 file(ARCHIVE*): Collapse FILES and DIRECTORY options
The two options were concatenated internally for both ARCHIVE_CREATE
and ARCHIVE_EXTRACT. The distinction between files and dirs was not
meaningful. Therefore, replace them with PATHS or PATTERNS 
to more accurately describe the way the options are used.

Fixes: #20884
2020-06-30 22:01:35 +10:00
Brad King
e5f5eeca2f file: Fix CONFIGURE output relative path
In commit a6fee09484 (file: Add CONFIGURE subcommand, 2020-03-06,
v3.18.0-rc1~584^2) we accidentally treated relative path outputs
with respect to the current working directory.  Treat them with
respect to the current binary directory instead.

Fixes: #20885
2020-06-29 09:20:42 -04:00
Craig Scott
95159b7dea file(ARCHIVE_CREATE): Rename TYPE option to COMPRESSION
Fixes: #20883
2020-06-27 18:38:28 +10:00
Dmitry Kalinkin
ef215b0851 cmFileCommand: Log cmsys::Glob warnings 2020-05-19 09:42:16 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Marc Chevrier
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> 2020-04-30 09:53:27 +02:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Harry Mallon
bf94dcba76 file(UPLOAD): Add support for TLS_VERIFY and TLS_CAINFO
* Improve and test err messages when TLS_VERIFY and TLS_CAINFO
  are not set in file(DOWNLOAD) and file(UPLOAD).
2020-04-08 15:15:49 +01:00
Harry Mallon
9427763081 file(UPLOAD): Add default ca_certs
Default ca_certs were not added when using `UPLOAD` with built-in
(non-system) cURL.  Previously we only did this for `DOWNLOAD`.

Fixes: #20551
2020-04-07 12:58:04 -04:00
Brad King
25f48761fa Simplify absolute path conversions using CollapseFullPath full signature 2020-03-24 10:10:06 -04:00
Cristian Adam
c7e1198a23 file: Add ARCHIVE_{CREATE|EXTRACT} subcommands
Fixes: #20443
2020-03-16 14:33:27 +01:00
Leander Beernaert
a6fee09484 file: Add CONFIGURE subcommand
Extend the `file()` command with a new `CONFIGURE` subcommand that
behaves the same as `string(CONFIGURE)` except that it writes the
resulting output immediately to a file.

Fixes: #20388
2020-03-09 11:54:02 -04:00
Kyle Edwards
c998c8d560 file(GET_RUNTIME_DEPENDENCIES): Tolerate empty list arguments
Also list all keywords that were missing values instead of only the
first one.
2020-01-22 14:34:33 -05:00
Johnny Jazeix
c0da651c09 file(DOWNLOAD): Don't fail if given just a filename to write to
Fixes: #17969
2020-01-15 10:03:35 -05:00
Marc Chevrier
f7d12609f0 Refactoring: use append functions from cmext/algorithm 2019-12-17 10:44:02 +01:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
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.
2019-10-01 12:26:36 -04:00
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
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
2019-09-20 10:01:37 -04:00
Asit Dhal
9dba84cfa5 Refactor: Use cmStrCat to construct error strings
Replace string construction using std::stringstream with cmStrCat and
cmWrap.
2019-09-18 14:18:46 -04:00
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Regina Pfeifer
d25a5a7ec9 clang-tidy: modernize-use-auto
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.
2019-09-10 22:21:41 +02:00
Regina Pfeifer
62e5f72289 clang-tidy: Replace typedef with using 2019-09-03 13:21:26 -04:00
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
Regina Pfeifer
d331021255 clang-tidy: isolate declarations for readability 2019-08-21 00:20:49 +02:00
Brad King
5f7386dd19 Merge topic 'string-literal-append'
da26b3be89 avoid adding multiple consecutive string literals to std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3698
2019-08-19 15:06:47 -04:00
Brad King
0b8524baa6 Merge topic 'cmCryptoHash_string_view'
f1c529c4fb cmCryptoHash: Accept cm::string_view input

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3697
2019-08-19 15:05:27 -04:00
Rolf Eike Beer
da26b3be89 avoid adding multiple consecutive string literals to std::string
While at it change some single character additions to be of type char.
2019-08-18 14:22:11 +02:00
Sebastian Holtermann
f1c529c4fb cmCryptoHash: Accept cm::string_view input 2019-08-18 14:17:50 +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
Kyle Edwards
dcf2beb7de Merge topic 'cmStringAlgorithms_ulong'
935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3681
2019-08-16 14:49:28 -04:00
Kyle Edwards
fb56ac9209 Merge topic 'retry-directory-delete'
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
2019-08-13 10:07:09 -04:00
Sebastian Holtermann
935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong
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.
2019-08-10 14:39:03 +02:00
Kitware Robot
54e9d38c28 Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAP 2019-08-09 10:41:44 -04:00
Kasper Laudrup
6bc77966ad Retry removing directories on Windows
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.
2019-08-08 15:59:02 +02:00
Regina Pfeifer
a7a5f376bc cmFileCommand: Use cmSubcommandTable 2019-08-06 17:21:52 +02:00