summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.h
Commit message (Collapse)AuthorAgeFilesLines
* Refactor: Add cmSystemTools::GetSystemName()Kyle Edwards2021-03-151-0/+3
| | | | And use it for CMAKE_HOST_SYSTEM_NAME and CMAKE_SYSTEM_NAME.
* cmSystemTools: add utilities to copy a file with error handlingBen Boeckel2021-03-091-0/+18
|
* cmSystemTools: Add RenameFile option to not replace destinationBrad King2021-03-041-1/+8
|
* cmSystemTools: Add RenameFile signature to capture the error messageBrad King2021-03-041-0/+8
|
* Makefile dependencies: ensure long paths are used on WindowsMarc Chevrier2021-01-091-0/+6
|
* CMake GUI: Add "CMake Reference Manual" help itemKyle Edwards2020-09-301-0/+1
| | | | And switch the ordering of "Help" and "About".
* file(ARCHIVE_CREATE): Add option to control compression levelAsit Dhal2020-09-211-1/+2
| | | | Fixes: #21125
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* cmSystemTools: Define directory-specific Windows filesystem retry settingsBrad King2020-08-271-0/+1
| | | | Inspired-by: Ron W Moore <webbtrail@gmail.com>
* Restore handling of build directory inside a symlinked pathBrad King2020-07-021-0/+3
| | | | | | | | | | | | | | | In commit dd8365b3f1 (Merge branch 'upstream-KWSys' into update-kwsys, 2020-04-06, v3.18.0-rc1~397^2) we imported KWSys commit `019afb6ea` (SystemTools: Drop GetCurrentWorkingDirectory 'collapse' argument, 2020-04-03). That caused `GetCurrentWorkingDirectory` to no longer send paths through the KWSys translation map and broke CMake's detection of the absolute path to a build directory containing a symbolic link. Add our own `cmSystemTools::GetCurrentWorkingDirectory` wrapper around the KWSys method in order to restore that mapping. Test-case-by: Ben Boeckel <ben.boeckel@kitware.com> Issue: #16228 Fixes: #20900
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-6/+9
| | | | | 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.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | 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
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* cmSystemTools: introduce MoveFileIfDifferent()Rolf Eike Beer2019-09-091-0/+4
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-2/+2
|
* cmSystemTools: Remove IsInternallyOn, IsNOTFOUND, IsOn, IsOffSebastian Holtermann2019-08-171-44/+0
| | | | | | | | | The removes the following methods from cmSystemTools: - `IsInternallyOn` - `IsNOTFOUND` - `IsOn` - `IsOff`
* Merge topic 'cmExpandList'Kyle Edwards2019-08-161-43/+0
|\ | | | | | | | | | | | | | | | | 2f6495e24e cmSystemTools: Remove ExpandListArgument methods f4f3c68926 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument ff42dec891 cmStringAlgorithms: Add cmExpandList functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3682
| * cmSystemTools: Remove ExpandListArgument methodsSebastian Holtermann2019-08-141-43/+0
| |
| * Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-2/+2
| |
* | Merge topic 'cmStringAlgorithms_ulong'Kyle Edwards2019-08-161-4/+0
|\ \ | |/ |/| | | | | | | | | 935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3681
| * cmStringAlgorithms: Add cmStrToLong and cmStrToULongSebastian Holtermann2019-08-101-4/+0
| | | | | | | | | | | | | | | | 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.
* | Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-1/+1
|/
* cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenizeSebastian Holtermann2019-08-051-12/+0
| | | | | | | | | | This adds the following functions to `cmStringAlgorithms`: - `cmIsSpace` - `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`) - `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`) - `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to accept `cm::string_view`)
* cmSystemTool: Let TrimWhitespace accept a cm::string_viewSebastian Holtermann2019-07-281-1/+1
|
* cmSystemTool: Let HelpFileName accept a cm::string_viewSebastian Holtermann2019-07-281-1/+1
|
* cmSystemTool: Let EscapeQuotes accept a cm::string_viewSebastian Holtermann2019-07-281-1/+1
|
* cmSystemTool: Let Expand(ed)ListArgument accept a cm::string_viewSebastian Holtermann2019-07-281-2/+2
|
* Merge topic 'remove_compiler_rpath'Kyle Edwards2019-07-261-0/+1
|\ | | | | | | | | | | | | | | bd2793b6e9 Help: Add documentation for INSTALL_REMOVE_ENVIROMENT_RPATH f08dcbffec Property: Add INSTALL_REMOVE_ENVIROMENT_RPATH property Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3544
| * Property: Add INSTALL_REMOVE_ENVIROMENT_RPATH propertyJiang Yue2019-07-251-0/+1
| |
* | cmSystemTools: Make IsInternallyOn, IsON and IsOff cm::string_view basedSebastian Holtermann2019-07-241-9/+29
|/
* cmSystemTools: Remove cmSystemTools::FileFormat methodSebastian Holtermann2019-07-041-26/+0
|
* Merge topic 'string-tar'Brad King2019-05-301-3/+3
|\ | | | | | | | | | | | | 57cedb18c0 cmSystemTools: std::string parameters for tar functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3392
| * cmSystemTools: std::string parameters for tar functionsVitaly Stakhovsky2019-05-291-3/+3
| |
* | Merge topic 'tar-zstd-compression'Brad King2019-05-301-0/+1
|\ \ | |/ |/| | | | | | | | | 53cb1f2d04 cmake: Teach cmake -E tar command, Zstandard compression Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3357
| * cmake: Teach cmake -E tar command, Zstandard compressionBartosz Kosiorek2019-05-221-0/+1
| | | | | | | | Fixes #18657
* | cmake: tar: Allow selective extracting and listing of archivesBartosz Kosiorek2019-05-231-2/+4
| |
* | Merge topic 'string-error'Brad King2019-05-231-2/+0
|\ \ | | | | | | | | | | | | | | | | | | e884b1b693 cmSystemTools::Error(): remove const char* overload Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3360
| * | cmSystemTools::Error(): remove const char* overloadVitaly Stakhovsky2019-05-221-2/+0
| |/
* | cmSystemTools: Remove cmSystemToolsFileTime interfaceSebastian Holtermann2019-05-221-14/+0
|/ | | | | This removes the C style cmSystemToolsFileTime interface in cmSystemTools. It was replaced by the RAII based cmFileTimes class.
* cmSystemTools: Add ExpandedListArgument and ExpandedLists methodsSebastian Holtermann2019-05-131-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes ------- In `cmSystemTools` this - renames the method `ExpandList` to `ExpandLists` and makes it iterator based and adds the methods - `std::vector<std::string> ExpandedLists(InputIt first, InputIt last)` - `std::vector<std::string> ExpandedListArgument(const std::string& arg, bool emptyArgs)` Both return the `std::vector<std::string>` instead of taking a return vector reference like `cmSystemTools::ExpandLists` and `cmSystemTools::ExpandListArgument`. Motivation ---------- Since C++17 return value optimization is mandatory, so returning a `std:vector<std::string>` from a function should be (at least) as fast as passing a return vector reference to the function. The new methods can replace `cmSystemTools::ExpandLists` and `cmSystemTools::ExpandListArgument` in many cases, which leads to shorter and simpler syntax. E.g. the commonly used pattern ``` if (const char* value = X->GetProperty("A_KEY_STRING")) { std::vector<std::string> valuesList; cmSystemTools::ExpandListArgument(value, valuesList); for (std::string const& i : valuesList) { doSomething(i); } } ``` becomes ``` if (const char* value = X->GetProperty("A_KEY_STRING")) { for (std::string const& i : cmSystemTools::ExpandedListArgument(value)) { doSomething(i); } } ```
* Ensure stdin, stdout, and stderr pipes are always openBrad King2019-05-021-0/+2
| | | | | | | | | | | | | On non-Windows platforms libuv assumes that file descriptors 0-2 are always used for standard pipes and never for anything else. Otherwise, libuv may re-use one of these descriptors and then fail an assertion when closing it. Similarly, On Windows platforms our ConsoleBuf implementation assumes that the standard handles are always open. If CMake is run with any standard pipes closed, open them with `/dev/null` or `NUL` to satisfy these assumptions. Fixes: #19219
* cmSystemTools: Remove unused message-related code, simplify logicAlex Turbov2019-04-271-3/+0
|
* Fix invalid ///! doxygen comment line startsSebastian Holtermann2019-03-311-11/+11
| | | | | In various places `///!` was used to start a comment line. This is not valid Doygen syntax. This patch replaces `///!` comment starts with `//!`.
* 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