summaryrefslogtreecommitdiffstats
path: root/Source/cmExecuteProcessCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmExecuteProcessCommand: Report keyword errors via argument parser resultsBrad King2022-07-221-8/+4
|
* cmArgumentParser: Avoid allocating copies of keyword stringsBrad King2022-07-051-3/+3
|
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-3/+3
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-2/+2
|
* clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-1/+1
|
* execute_process: Improve COMMAND_ERROR_IS_FATAL error capture scenariosAsit Dhal2020-12-101-31/+87
| | | | | | | | | | | 1. COMMAND_ERROR_IS_FATAL ANY will capture errors if the exit code is non zero, there is a timeout or an abnormal exit. 2. COMMAND_ERROR_IS_FATAL LAST will capture if only the last process has an exit code non zero, there is a timeout or an abnormal exit. Fixes: #21562
* execute_process: add options for fatal errors on subprocess failureAsit Dhal2020-10-011-1/+57
| | | | Fixes: #19930
* Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-301-2/+1
|
* execute_process: Add ECHO_(OUTPUT|ERROR)_VARIABLE optionsCristian Adam2020-02-241-7/+15
| | | | Fixes: #20378
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-2/+3
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-3/+4
| | | | | 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.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-2/+2
|
* cmCommand refactor: cmExecuteProcessCommandGabor Bencze2019-08-201-36/+42
|
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-1/+1
| | | | | | | | | | | | | | | | This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value argument instead of a `const char *`. Benefits are: - `std::string` can be passed to `cmMakefile::AddDefinition` directly without the `c_str()` plus string length recomputation fallback. - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at compile time. In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid `std::string::c_str` calls and the `std::string` is passed directly. Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
* modernize: manage cmCommand instances using unique_ptr.Marc Chevrier2019-07-141-1/+0
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-0/+3
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-1/+1
|
* execute_process: Add option to echo command linesBill Hoffman2019-04-191-1/+49
| | | | | | | | | | Add COMMAND_ECHO option to the execute_process command. This will allow execute_process to show the command it will run. Also add a cmake variable CMAKE_EXECUTE_PROCESS_COMMAND_ECHO. Both the option and the variable can be set to one of the following: STDERR|STDOUT|NONE. The command will be printed to stderr or stdout or not at all. Fixes: #18933
* execute_process: Manage KWSys Process lifetime with unique_ptrBrad King2019-04-191-4/+3
|
* cmExecuteProcessCommand: Port to cmArgumentParserRegina Pfeifer2019-04-041-170/+110
|
* Prefer front/back/data over dereferencing begin/rbegin iterArtur Ryt2019-02-061-3/+3
| | | | Changed for sequenced containers: vector, list, string and array
* Merge topic 'Wcomma'Brad King2019-01-221-1/+1
|\ | | | | | | | | | | | | 5ff7fb592e Fixed all but one clang -Wcomma warning Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2828
| * Fixed all but one clang -Wcomma warningSean McBride2019-01-121-1/+1
| |
* | Merge topic 'stdout-string'Brad King2019-01-221-4/+4
|\ \ | | | | | | | | | | | | | | | | | | 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/+4
| |/
* | clang-tidy: Use emplaceRegina Pfeifer2019-01-171-4/+4
|/
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-1/+1
| | | | | | | | | | * 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.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-5/+5
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* Replace C-style castsDaniel Pfeifer2017-08-271-1/+1
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-3/+3
|
* execute_process: Add option to get results of every childAdam Weisi2017-06-101-1/+52
| | | | | Add a `RESULTS_VARIABLE` option to get the results of all children in a pipeline of one or more `COMMAND`s.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | 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'
* execute_process: Restore no-decoding default behaviorBrad King2017-02-131-1/+1
| | | | | | | | | | | Since commit v3.8.0-rc1~232^2 (execute_process: Add ENCODING option for Windows child process output, 2016-11-23) we decode child process output using the console's active codepage by default. This differs from previous versions of CMake and is therefore incompatible. Changing this default will require a policy, so for now revert the default behavior back to performing no decoding. Reported-by: Nils Gladitz <nilsgladitz@gmail.com>
* execute_process: Add ENCODING option for Windows child process outputDāvis Mosāns2016-11-301-1/+10
| | | | Different applications can use different output encodings.
* Windows: Encode child process output to internally-used encodingDāvis Mosāns2016-11-141-2/+21
| | | | | | Typically Windows applications (eg. MSVC compiler) use current console's codepage for output to pipes so we need to encode that to our internally-used encoding (`KWSYS_ENCODING_DEFAULT_CODEPAGE`).
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-3/+7
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Avoid else after returnDaniel Pfeifer2016-09-161-3/+2
|
* use empty method to check for emptynessDaniel Pfeifer2016-09-151-1/+1
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-3/+3
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-207/+109
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* execute_process: Improve stdout/stderr mergingBrad King2015-05-071-5/+19
| | | | | | | Use the KWSys Process "MergeOutput" option to give the child process the same pipe (or file) for both stdout and stderr. This allows natural merging of stdout and stderr together instead of merging on arbitrary buffered read boundaries as before.
* Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-2/+2
|
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-1/+1
| | | | All compilers hosting CMake support the std class.
* execute_process: Send stderr through cmSystemTools::StderrBrad King2014-05-151-5/+5
| | | | | Give cmake-gui and ctest --build-and-test a chance to capture the output instead of sending it to the real stderr.
* Remove some c_str() calls.Stephen Kelly2014-03-111-8/+8
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.