summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmSystemTools: Let `GetFileFormat` accept a `std::stding const&`Sebastian Holtermann2019-02-021-4/+2
| | | | | The `const char*` used formerly was converted to a `std::string` internally anyway.
* OutputCallback: Accept std::string argumentRegina Pfeifer2019-01-301-2/+2
|
* Merge topic 'functional-callbacks'Brad King2019-01-301-26/+21
|\ | | | | | | | | | | | | | | | | | | 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-1/+1
| |
| * Use `std::function` for callbacksRegina Pfeifer2019-01-291-26/+21
| |
* | cmSystemTools: copy file member functions accept std::string paramsVitaly Stakhovsky2019-01-291-7/+2
|/ | | | | Cleaned up `c_str()`s. `cmSystemTools::CopyFileIfDifferent()` removed as redundant.
* cmSystemTools::Message: Add overload accepting std::stringVitaly Stakhovsky2019-01-281-2/+2
|
* Merge topic 'renamefile-string'Brad King2019-01-251-2/+3
|\ | | | | | | | | | | | | 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-2/+3
| |
* | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-6/+13
|/
* Merge topic 'stdout-string'Brad King2019-01-221-24/+12
|\ | | | | | | | | | | | | 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-24/+12
| |
* | Merge topic 'use-emplace'Brad King2019-01-211-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | ef61997b1b clang-tidy: Use emplace 2e5307a2a4 CTestSVN: Accept std::string in SVNInfo constructor Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2811
| * | clang-tidy: Use emplaceRegina Pfeifer2019-01-171-3/+3
| |/
* | cmSystemTools: Silence CreateLink and CreateSymlink errorsTushar Maheshwari2019-01-161-4/+14
| | | | | | | | | | 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/+16
|/ | | | | | | | | | | | | | 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/+75
|
* cmSystemTools: Add EncodeURL helperBrad King2018-11-281-0/+29
| | | | | | | Factor a URL encoding implementation out of CTest. Add an option to not escape slashes. Suggested-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Mark operator bool explicitRegina Pfeifer2018-11-191-1/+4
|
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-2/+2
|
* Merge topic 'tar-warnings'Brad King2018-10-251-13/+31
|\ | | | | | | | | | | | | 95c8a03f00 cmake: Distinguish '-E tar' warnings from errors copying data Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2519
| * cmake: Distinguish '-E tar' warnings from errors copying dataBrad King2018-10-241-13/+31
| | | | | | | | | | | | | | | | 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
| * Merge branch 'restore-windows-resources-through-link' into release-3.12Brad King2018-06-131-1/+2
| |\ | | | | | | | | | Merge-request: !2147
* | | Fix misc. typosluz.paz2018-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | | cmake: Add '-E create_symlink' support on WindowsJon Chronopoulos2018-09-181-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Re-implement IsOn,IsOff with manual branchingBrad King2018-08-311-35/+56
| | | | | | | | | | | | | | | | | | 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.
* | | cmSystemTools: Add IsOn(),IsOff() overloads accepting std::stringVitaly Stakhovsky2018-08-311-0/+10
| | |
* | | Merge topic 'restore-windows-resources-through-link'Brad King2018-06-131-1/+2
|\ \ \ | |/ / |/| / | |/ | | | | | | 4e6ff0ae24 Windows: Restore support for running CMake through a symlink Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2147
| * Windows: Restore support for running CMake through a symlinkBrad King2018-06-121-1/+2
| | | | | | | | | | | | | | | | | | | | 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
* | cmSystemTools: Restore compilation with libarchive versions below 3.3.1Brad King2018-06-011-1/+5
| | | | | | | | | | | | | | In commit a203fcc63d (cmake: Teach '-E tar' to report errors copying data, 2018-05-16) we introduced use of `la_ssize_t` but that was not available until libarchive 3.3.1. Switch to the `__LA_SSIZE_T` macro we use elsewhere.
* | Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-67/+67
| | | | | | | | | | | | | | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* | Merge topic 'revert-windows_symlinks'Brad King2018-05-311-3/+7
|\ \ | |/ | | | | | | | | | | 83630d4918 cmSystemTools: Revert GetRealPath implementation on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2114
| * cmSystemTools: Revert GetRealPath implementation on WindowsBrad King2018-05-291-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | cmake: Teach '-E tar' to report errors copying dataRuslan Baratov2018-05-181-8/+18
| | | | | | | | | | The `copy_data` function checks for errors but the caller ignored them. Simplify its return type and add a check to the caller.
* | Drop Visual Studio 8 2005 generatorBrad King2018-04-021-1/+1
|/ | | | This generator has been deprecated since CMake 3.9. Remove it.
* cmSystemTools: Fix ParseArguments out-of-bounds readBrad King2018-03-271-6/+7
| | | | | | | When checking for a Windows-style leading path, do not read past the null terminator. Issue: #17854
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-12/+13
| | | | | | | | | | * 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 'reduce-temporaries'Brad King2018-01-291-1/+1
|\ | | | | | | | | | | | | c85bb007 Reduce allocation of temporary values on heap. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1698
| * Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-1/+1
| | | | | | | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* | Merge topic 'ctest-chrono'Brad King2018-01-261-5/+8
|\ \ | |/ |/| | | | | | | | | | | | | 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-5/+8
| | | | | | | | | | | | | | | | 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.
* | Windows: Add support for running CMake tools through a symlinkPavel P2018-01-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | When `cmake.exe` is executed through a symlink, `GetModuleFileNameW` will return location of the link instead of the real path of `cmake.exe`. This results in the following error output: CMake Error: Could not find CMAKE_ROOT !!! CMake has most likely not been installed correctly. Use `cmSystemTools::GetRealPath` in `FindCMakeResources` on Windows to resolve any symlink returned by `GetModuleFileNameW`.
* | Extend libuv file translate mode workaround to all executablesBrad King2018-01-231-0/+17
|/ | | | | | | | | | | | | | | 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
* CUDA: Add cu as default source file extensionRobert Maynard2018-01-081-0/+3
|
* cmSystemTools: Implement GetRealPath on WindowsManuel Núñez2017-10-241-0/+35
| | | | | | | Override the KWSys GetRealPath on Windows and use uv_fs_realpath first to resolve symbolic links. Fixes: #17206
* Fix occurrences of readability-non-const-parameterMatthias Maennich2017-09-281-12/+14
| | | | | | | | | | | Fix issues diagnosed by clang-tidy [readability-non-const-parameter] The patch separates the definitions of the function headers for the two variants (CMAKE_USE_ELF_PARSER or not) and comments out the parameter names to not consider them for any const-ness in the case they are actually not even looked at. Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Improve several occurrences of vector::push_back in loopsMatthias Maennich2017-09-281-0/+1
| | | | | | | Fix issues diagnosed by clang-tidy by pre-allocating the vector capacity before the loop [performance-inefficient-vector-operation]. Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Clean up some C-Style castsMatthias Maennich2017-09-281-1/+1
| | | | | | Fix issues diagnosed by clang-tidy [google-readability-casting] Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Merge topic 'rc-missing-better-error'Brad King2017-09-251-0/+4
|\ | | | | | | | | | | | | | | 0a8e23ad Windows: Improve link-time error messages when rc or mt fail c2d6835c cmSystemTools: Teach RunSingleCommand another way to report exceptions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1260
| * cmSystemTools: Teach RunSingleCommand another way to report exceptionsJonathan Marler2017-09-201-0/+4
| | | | | | | | | | If the caller captures stdout but not stderr then report exceptions through stdout instead of dropping them.