summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'tar-improve-error-handling'Kyle Edwards2019-03-211-0/+9
|\ | | | | | | | | | | | | ea9a2c1759 cmake: tar: Parse 'cmake -E tar' arguments Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3081
| * cmake: tar: Parse 'cmake -E tar' argumentsBartosz Kosiorek2019-03-201-0/+9
| |
* | cmSystemTools: Drop unused CollapseCombinedPath methodBrad King2019-03-191-6/+0
|/ | | | | | | All call sites have been converted to `CollapseFullPath`, so the now-unused `CollapseCombinedPath` can be removed. Fixes: #19050
* cmSystemTools: More functions accept `std::string` paramsVitaly Stakhovsky2019-02-201-4/+4
|
* cmSystemTools: Remove redundant cmCopyFile() and Split()Vitaly Stakhovsky2019-02-151-7/+0
|
* cmSystemTools: More methods accept `std::string` paramsVitaly Stakhovsky2019-02-111-7/+9
|
* Merge topic 'message-stdstring'Brad King2019-02-081-6/+2
|\ | | | | | | | | | | | | 82edd98300 cmSystemTools: MessageCallback and Message() accept std::string argument Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2929
| * cmSystemTools: MessageCallback and Message() accept std::string argumentVitaly Stakhovsky2019-02-071-6/+2
| |
* | cmSystemTools::RunSingleCommand: Accept std::string argumentVitaly Stakhovsky2019-02-061-1/+1
|/
* cmSystemTools: Let `GetFileFormat` accept a `std::stding const&`Sebastian Holtermann2019-02-021-1/+1
| | | | | The `const char*` used formerly was converted to a `std::string` internally anyway.
* Merge topic 'std-string-callback'Brad King2019-01-311-1/+1
|\ | | | | | | | | | | | | | | 1180fc8780 OutputCallback: Accept std::string argument Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: vvs31415 <vstakhovsky@fastmail.com> Merge-request: !2891
| * OutputCallback: Accept std::string argumentRegina Pfeifer2019-01-301-1/+1
| |
* | Merge topic 'tidy-use-equals-delete'Brad King2019-01-301-1/+3
|\ \ | |/ |/| | | | | | | | | | | b05b778a2d clang-tidy: Use `= delete` Acked-by: Kitware Robot <kwrobot@kitware.com> Rejected-by: vvs31415 <vstakhovsky@fastmail.com> Merge-request: !2848
| * clang-tidy: Use `= delete`Regina Pfeifer2019-01-291-1/+3
| |
* | Merge topic 'functional-callbacks'Brad King2019-01-301-19/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | MessageCallback: Remove unused bool& argumentRegina Pfeifer2019-01-291-3/+2
| | |
| * | Use `std::function` for callbacksRegina Pfeifer2019-01-291-17/+8
| |/
* | cmSystemTools: copy file member functions accept std::string paramsVitaly Stakhovsky2019-01-291-2/+2
|/ | | | | Cleaned up `c_str()`s. `cmSystemTools::CopyFileIfDifferent()` removed as redundant.
* cmSystemTools::Message: Add overload accepting std::stringVitaly Stakhovsky2019-01-281-0/+4
|
* Merge topic 'renamefile-string'Brad King2019-01-251-1/+2
|\ | | | | | | | | | | | | 9e5c13738b cmSystemTools::RenameFile: Accepts std::string args Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2842
| * cmSystemTools::RenameFile: Accepts std::string argsVitaly Stakhovsky2019-01-231-1/+2
| |
* | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-0/+1
|/
* Merge topic 'stdout-string'Brad King2019-01-221-4/+2
|\ | | | | | | | | | | | | 3132ea801c cmSystemTools: Stdout(),Stderr() accept std::string argument Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2829
| * cmSystemTools: Stdout(),Stderr() accept std::string argumentVitaly Stakhovsky2019-01-201-4/+2
| |
* | cmSystemTools: Silence CreateLink and CreateSymlink errorsTushar Maheshwari2019-01-161-2/+4
| | | | | | | | | | If provided, report errors to a std::string. This allows "silent" fallback to another flow, like COPY_ON_ERROR.
* | cmFileCommand: Add CREATE_LINK subcommandTushar Maheshwari2019-01-161-0/+5
|/ | | | | | | | | | | | | | 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
* cmOutputConverter: Moved ForceToRelativePath to cmSystemBruno Manganelli2018-12-071-0/+8
|
* cmSystemTools: Add EncodeURL helperBrad King2018-11-281-0/+4
| | | | | | | Factor a URL encoding implementation out of CTest. Add an option to not escape slashes. Suggested-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* cmake: Add '-E create_symlink' support on WindowsJon Chronopoulos2018-09-181-0/+5
| | | | | | | | | | | | 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.
* cmSystemTools: Add IsOn(),IsOff() overloads accepting std::stringVitaly Stakhovsky2018-08-311-0/+2
|
* Fix misc. typosluz.paz2018-06-041-1/+1
| | | | Found via `codespell` and `grep`
* cmSystemTools: Revert GetRealPath implementation on WindowsBrad King2018-05-291-4/+6
| | | | | | | | | | | | | | | The use of `uv_fs_realpath` introduced by commit v3.11.0-rc1~445^2~1 (cmSystemTools: Implement GetRealPath on Windows, 2017-10-02) causes `subst` drives to be expanded on Windows, breaking existing use cases. Revert its use until an alternative implementation can be chosen. Preserve the behavior introduced by commit v3.11.0-rc1~445^2 (cmTimestamp: For symlinks switch to timestamp of resolved path, 2017-10-02) by retaining use of `uv_fs_realpath` in a function of a different name. Fixes: #18033 Issue: #17206
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-2/+3
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Merge topic 'ctest-chrono'Brad King2018-01-261-3/+4
|\ | | | | | | | | | | | | | | | | e6a80ccf Make use of std::chrono throughout every component ff62b005 CTest: add safe conversion from cmDuration to integer types 695951bc CTest: introduce cmDuration Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1592
| * Make use of std::chrono throughout every componentWouter Klouwen2018-01-231-3/+4
| | | | | | | | | | | | | | | | This commit continues the changes made in CTest to support std::chrono by applying it throughout every component where a duration was used. No functional change intended.
* | Extend libuv file translate mode workaround to all executablesBrad King2018-01-231-0/+4
|/ | | | | | | | | | | | | | | Since libuv commit v1.14.1~7 (win: add uv__once_init() calls, 2017-08-30) the libuv initialization of the file translate mode may take place even if we do not use a uv loop. This change was included in our libuv update commit f4a26c748b (libuv 2018-01-19). Therefore use of libuv even through `cmSystemTools::GetRealPath` in any executable may trigger its file translate mode setting. Factor out the logic added to `cmake.exe` by commit v3.9.0-rc4~10^2 (cmake: Fix default file translate mode when using libuv, 2017-06-13) and re-use to initialize all executables. Issue: #16962
* Merge topic 'add_cuda_to_source_regex'Craig Scott2018-01-091-0/+1
|\ | | | | | | | | | | | | | | 81868e6b CUDA: Add cu as default source file extension Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Brad King <brad.king@kitware.com> Merge-request: !1629
| * CUDA: Add cu as default source file extensionRobert Maynard2018-01-081-0/+1
| |
* | Various typo fixesLuz Paz2018-01-031-3/+3
|/ | | | Some are user-facing. Others are source comments.
* cmSystemTools: Implement GetRealPath on WindowsManuel Núñez2017-10-241-0/+4
| | | | | | | Override the KWSys GetRealPath on Windows and use uv_fs_realpath first to resolve symbolic links. Fixes: #17206
* get_filename_component: Revise PROGRAM/PROGRAM_ARGS split semanticsBrad King2017-09-131-0/+5
| | | | | | | | | | | | | | | | | | | | The KWSys `SystemTools::SplitProgramFromArgs` implementation goes into an infinite loop when the value is just " " (a space). Since the "program path with unquoted spaces plus command-line arguments" operation it is trying to provide is poorly defined (string parsing should not depend on filesystem content), just stop using it. Instead consider the main two use cases the old approach tried to handle: * The value is the name or absolute path of a program with no quoting or escaping, but also no command-line arguments. In this case we can use the value as given with no parsing, and assume no arguments. * The value is a command-line string containing the program name/path plus arguments. In this case we now assume that the command line is properly quoted or escaped. Fixes: #17262
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-20/+19
|
* Change ComputeFileMD5 to ComputeFileHashAndré Klitzing2017-07-141-2/+4
| | | | | | | * Use a parameter to select hash algorithm * Return a std::string as result or an empty string if it fails * Avoids unnecessary copy of hash value
* Merge topic 'ninja-dyndep-response-file'Brad King2017-04-251-0/+7
|\ | | | | | | | | | | | | 594d3d6f Ninja: support response file for cmake_ninja_depends on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !722
| * Ninja: support response file for cmake_ninja_depends on WindowsBernhard Burgermeister2017-04-251-0/+7
| | | | | | | | | | | | | | The internal tool "cmake_ninja_depends" now supports reading the list of ddi files from a reponse file to circumvent Windows command line length limits. Use this response file for dyndep rule on Windows.
* | Use CM_DISABLE_COPYDaniel Pfeifer2017-04-241-4/+2
| |
* | cmSystemTools::SaveRestoreEnvironment: make noncopyableDaniel Pfeifer2017-04-211-1/+4
|/ | | | Also, make the destructor non-virtual.
* Ninja,Makefile: Unify command line limit logicChristian Pfeiffer2017-04-191-0/+2
| | | | | | Move the logic to cmSystemTools to be shared among the generators. Revise the implementation and add comments justifying each possible source for a limit.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-3/+3
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'