Alex Turbov
377d1b7896
cmSystemTools: Remove unused message-related code, simplify logic
2019-04-27 18:36:45 +10:00
Brad King
f0948499f6
cmSystemTools: Fix StringToULong to reject negative numbers
...
Fixes : #19161
2019-04-11 12:56:32 -04:00
Brad King
23a84ac990
Merge topic 'dedup-path-normalization'
...
b52d9d6960 cmSystemTools: Drop unused CollapseCombinedPath method
a13a5c948e Replace use of CollapseCombinedPath with CollapseFullPath
Acked-by: Kitware Robot <kwrobot@kitware.com >
Acked-by: Sebastian Holtermann <sebholt@xwmw.org >
Merge-request: !3117
2019-03-20 11:32:12 -04:00
Brad King
b52d9d6960
cmSystemTools: Drop unused CollapseCombinedPath method
...
All call sites have been converted to `CollapseFullPath`, so the
now-unused `CollapseCombinedPath` can be removed.
Fixes : #19050
2019-03-19 10:00:08 -04:00
Bartosz Kosiorek
8634576dcb
cmake: Don't interrupt archive creation if unable to read a file.
...
Rationale:
Currently during creation of archive by 'tar',
if error appears, it interrupt archive creation.
As a result only part of files are archived
This behaviour is not consistent with 'copy_directory', native 'tar'
and other command behaviour.
With this Merge Request this behaviour is fixed.
2019-03-18 17:55:35 +01:00
Brad King
a4d99e4dec
Merge topic 'cmrange-improvements'
...
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
2019-02-25 08:03:01 -05:00
Brad King
94970cd042
Merge topic 'error-consolidate'
...
9dd255548d cmSystemTools::Error: consolidate parameters into single std::string
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2995
2019-02-25 08:02:07 -05:00
Regina Pfeifer
9eb0e73f46
cmRange: Move to dedicated header file
2019-02-21 08:24:25 -05:00
Vitaly Stakhovsky
4e315e9449
cmSystemTools: More functions accept std::string params
2019-02-20 14:53:39 -05:00
Vitaly Stakhovsky
9dd255548d
cmSystemTools::Error: consolidate parameters into single std::string
2019-02-20 11:18:11 -05:00
Brad King
03e10384ec
Merge topic 'delete_copy_assign'
...
ae5e97a005 Delete some default constructors and assignment operators
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2968
2019-02-18 09:05:30 -05:00
Vitaly Stakhovsky
bd20cc29a2
cmSystemTools: Remove redundant cmCopyFile() and Split()
2019-02-15 09:52:29 -05:00
Albert Astals Cid
ae5e97a005
Delete some default constructors and assignment operators
...
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
2019-02-15 07:25:47 -05:00
Vitaly Stakhovsky
080a79ca4a
cmSystemTools: More methods accept std::string params
2019-02-11 18:11:59 -05:00
Brad King
4b37b4f1bb
Merge topic 'modernize-for-loops'
...
01b2d6ab74 Modernize: Use ranged for-loops when possible
15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues
Acked-by: Kitware Robot <kwrobot@kitware.com >
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de >
Merge-request: !2901
2019-02-11 08:08:22 -05:00
Brad King
89ca5d7fdc
Merge topic 'message-stdstring'
...
82edd98300 cmSystemTools: MessageCallback and Message() accept std::string argument
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2929
2019-02-08 08:49:35 -05:00
Brad King
9783825de5
Merge topic 'runsinglecommand'
...
65baaa0e37 cmSystemTools::RunSingleCommand: Accept std::string argument
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2927
2019-02-08 08:47:56 -05:00
Artur Ryt
01b2d6ab74
Modernize: Use ranged for-loops when possible
...
Replaced most manual `const_iterator`-based loops and some
reverse-iterator loops with range loops.
Fixes : #18858
2019-02-07 22:39:05 +01:00
Vitaly Stakhovsky
82edd98300
cmSystemTools: MessageCallback and Message() accept std::string argument
2019-02-07 13:41:27 -05:00
Vitaly Stakhovsky
65baaa0e37
cmSystemTools::RunSingleCommand: Accept std::string argument
2019-02-06 11:02:10 -05:00
Artur Ryt
f3534386b5
Prefer front/back/data over dereferencing begin/rbegin iter
...
Changed for sequenced containers: vector, list, string and array
2019-02-06 10:43:16 -05:00
Sebastian Holtermann
ed0fa784eb
cmSystemTools: Let GetFileFormat accept a std::stding const&
...
The `const char*` used formerly was converted to a `std::string`
internally anyway.
2019-02-02 18:42:08 +01:00
Regina Pfeifer
1180fc8780
OutputCallback: Accept std::string argument
2019-01-30 18:33:58 +01: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
Regina Pfeifer
8c92db829b
MessageCallback: Remove unused bool& argument
2019-01-29 16:35:53 +01: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
Regina Pfeifer
bcee24aecc
Use std::function for callbacks
2019-01-29 16:32:52 +01:00
Vitaly Stakhovsky
186d9b083d
cmSystemTools::Message: Add overload accepting std::string
2019-01-28 09:35:51 -05:00
Brad King
c18fc30d1a
Merge topic 'renamefile-string'
...
9e5c13738b cmSystemTools::RenameFile: Accepts std::string args
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2842
2019-01-25 08:00:14 -05:00
Vitaly Stakhovsky
99337d345b
cmSystemTools::Error(): new overload accepting std::string
2019-01-23 10:19:30 -05:00
Vitaly Stakhovsky
9e5c13738b
cmSystemTools::RenameFile: Accepts std::string args
2019-01-22 20:37:59 -05:00
Brad King
cb7fbf1dbb
Merge topic 'stdout-string'
...
3132ea801c cmSystemTools: Stdout(),Stderr() accept std::string argument
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2829
2019-01-22 09:32:58 -05:00
Brad King
4dba5d6ce2
Merge topic 'use-emplace'
...
ef61997b1b clang-tidy: Use emplace
2e5307a2a4 CTestSVN: Accept std::string in SVNInfo constructor
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2811
2019-01-21 07:51:54 -05:00
Vitaly Stakhovsky
3132ea801c
cmSystemTools: Stdout(),Stderr() accept std::string argument
2019-01-20 00:03:35 -05:00
Regina Pfeifer
ef61997b1b
clang-tidy: Use emplace
2019-01-17 13:12:02 -05:00
Tushar Maheshwari
0f08ed8936
cmSystemTools: Silence CreateLink and CreateSymlink errors
...
If provided, report errors to a std::string.
This allows "silent" fallback to another flow, like COPY_ON_ERROR.
2019-01-16 10:03:35 -05:00
Tushar Maheshwari
81650e488c
cmFileCommand: Add CREATE_LINK subcommand
...
This brings the functionality of `cmake -E create_symlink` and more to scripts.
The default behavior is to create hard links.
The `SYMBOLIC` argument can be used to create symlinks instead.
The `COPY_ON_ERROR` argument enables a fallback to copying the file in case the link fails.
The `RESULT <var>` retrieves the error message generated by the system.
It is set to "0" on success.
Fixes : #16926
2019-01-16 10:03:35 -05:00
Bruno Manganelli
87e810f223
cmOutputConverter: Moved ForceToRelativePath to cmSystem
2018-12-07 19:29:30 +00:00
Brad King
652210e901
cmSystemTools: Add EncodeURL helper
...
Factor a URL encoding implementation out of CTest.
Add an option to not escape slashes.
Suggested-by: Daniel Pfeifer <daniel@pfeifer-mail.de >
2018-11-28 14:27:22 -05:00
Regina Pfeifer
a2648dda97
Mark operator bool explicit
2018-11-19 23:35:09 +01:00
Cengizhan Pasaoglu
c67ab22cdc
Using front() and back() instead of calculations
2018-11-06 21:43:33 +03:00
Brad King
1c31eae659
Merge topic 'tar-warnings'
...
95c8a03f00 cmake: Distinguish '-E tar' warnings from errors copying data
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2519
2018-10-25 07:25:45 -04:00
Brad King
95c8a03f00
cmake: Distinguish '-E tar' warnings from errors copying data
...
The logic added by commit v3.12.0-rc1~62^2 (cmake: Teach '-E tar' to
report errors copying data, 2018-05-16) incorrectly reports failure
in the case of ARCHIVE_WARN. Convert this case to a warning.
Fixes : #18496
2018-10-24 10:51:11 -04:00
luz.paz
6b4c5a0365
Fix misc. typos
...
Found via `codespell -q 3 -I ../cmake-whitelist.txt --skip="./Utilities"`
where the whitelist consists of
```
aci
ans
behaviour
buil
convertor
dum
earch
ect
emmited
emmitted
helpfull
iff
isnt
ith
lowercased
mose
nd
nknown
nto
objext
ot
pathes
pevents
splitted
substract
superceded
supercedes
te
tim
todays
uint
upto
whitespaces
```
2018-10-03 15:32:46 -04:00
Jon Chronopoulos
afb7f6e4ff
cmake: Add '-E create_symlink' support on Windows
...
The allows `-E create_symlink` to work on Windows. It utilizes
`uv_fs_symlink`. I am still unsure exactly which Windows platforms will
work without requiring Administrator privileges or needing a user/group
with the "Create Symbolic Links" User Rights. It does work with my
Windows 10 Pro with Developer Mode turned on. In the test suite check
that the symlink either worked or failed with a permissions error.
Use recent changes in cmSystemTools::FileExists to check that a symlink
is broken.
2018-09-18 11:24:08 -04:00
Brad King
1bfe6991ff
cmSystemTools: Re-implement IsOn,IsOff with manual branching
...
Replace use of std::string allocation, std::set lookups, and toupper
conversions with explicit manual logic to do case-insensitive
recognition of a specific set of strings.
2018-08-31 14:58:03 -04:00
Vitaly Stakhovsky
1fa0f2bd03
cmSystemTools: Add IsOn(),IsOff() overloads accepting std::string
2018-08-31 14:58:03 -04:00
Brad King
985c78c7e1
Merge branch 'restore-windows-resources-through-link' into release-3.12
...
Merge-request: !2147
2018-06-13 10:52:01 -04:00
Brad King
38e4246f37
Merge topic 'restore-windows-resources-through-link'
...
4e6ff0ae24 Windows: Restore support for running CMake through a symlink
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !2147
2018-06-13 10:44:45 -04:00
Brad King
4e6ff0ae24
Windows: Restore support for running CMake through a symlink
...
The change in commit v3.11.3~3^2 (cmSystemTools: Revert GetRealPath
implementation on Windows, 2018-05-29) broke the feature added by commit
v3.11.0-rc1~64^2 (Windows: Add support for running CMake tools through a
symlink, 2018-01-21). Use `GetRealPathResolvingWindowsSubst` in the
latter code path to restore it.
Fixes : #17882
2018-06-12 11:15:50 -04:00