summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/execute_process
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'fix-cmake_determine_linker_id-error-handling' into release-4.2Brad King2025-10-222-0/+4
|\ | | | | | | | | | | | | | | 69e2f3f8ea Linker: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL set to ANY 576e63f28d Compilers: Use -print-sysroot output only with successful exit code Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !11313
| * Linker: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL set to ANYTristan Daifuku2025-10-202-0/+4
| | | | | | | | Tolerate expected failures of linkers invoked via `execute_process`.
* | Tests/RunCMake: Match dots more precisely, part 3AJIOB2025-10-2011-13/+13
| |
* | Tests/RunCMake: Match xxx.cmake file name more preciselyAJIOB2025-10-163-3/+3
| |
* | Tests/RunCMake: Match CMakeLists.txt file name more preciselyHanna Rusakovich2025-10-151-1/+1
|/
* execute_process: Improve invocation of .cmd/.bat with spacesBrad King2025-02-111-5/+1
| | | | | | | | | | Extend the fix from commit 74c9d40876 (execute_process: Fix invocation of .cmd/.bat with spaces, 2025-01-31) to work without relying on conversion to a "short path", which may not exist. Instead, extending the `cmd /c` wrapper to `cmd /c call` seems to support spaces directly. Suggested-by: Alexandru Croitor <alexandru.croitor@qt.io> Fixes: #26655
* execute_process: Fix invocation of .cmd/.bat with spacesBrad King2025-02-035-0/+26
| | | | | | | | | | | The `CreateProcessW` documentation states "to run a batch file, you must start the command interpreter". Use `cmd /c the.bat` to run batch files. Also, use a "short path" to the `.bat` file if needed to avoid spaces. Previously this worked in some cases only due to undocumented behavior of `CreateProcessW` when given a `.bat` file. Fixes: #26655
* execute_process: Allow setting default COMMAND_ERROR_IS_FATAL valueMartin Duffy2025-01-1512-1/+74
| | | | Issue: #26576
* Tests/RunCMake: Update cmake_minimum_required versions to 3.10Brad King2024-10-031-1/+1
| | | | | For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.10 where possible.
* execute_process: Warn on unknown ENCODING valueBrad King2024-09-173-0/+7
|
* execute_process: Change default ENCODING to UTF-8Brad King2024-09-168-2/+21
| | | | | | | | | | | | | Windows is heading toward making UTF-8 the preferred MBCS. As CMake's internal encoding, `UTF-8` is effectively equivalent to `NONE`, which was CMake's behavior prior to 3.15's accidental change to `AUTO`. Behavior of `ENCODING UTF-8` is independent of CMake's internal encoding, making it in principle a better default than `NONE`. Add policy CMP0176 for compatibility and to document the default's history. Fixes: #26262
* execute_process: Document and test ENCODING defaultBrad King2024-09-133-0/+6
| | | | | | | | | | | | | | The default was originally AUTO in commit 2ed473b3b8 (execute_process: Add ENCODING option for Windows child process output, 2016-11-23, v3.8.0-rc1~232^2) but was changed back to NONE by commit 07c3380a6e (execute_process: Restore no-decoding default behavior, 2017-02-13, v3.8.0-rc2~26^2) for CMake 3.8. Later it was accidentally changed back to AUTO by commit b783e62533 (cmExecuteProcessCommand: Port to cmArgumentParser, 2019-03-25, v3.15.0-rc1~270^2) in CMake 3.15 but the documentation was not updated. Document the current default, AUTO, and add a test case to verify it. Issue: #26262
* Tests/RunCMake/execute_process: Add test for ENCODING AUTOBrad King2024-09-136-5/+37
| | | | | On Windows the AUTO encoding is based on the console code page, so run the test in an isolated console window.
* Tests/RunCMake/execute_process: Improve test for ENCODING UTF-8Brad King2024-09-126-6/+12
| | | | Generalize the test infrastructure. Add Chinese text to the sample.
* Merge topic 'execute_process-child-startup-info'Brad King2024-05-282-0/+5
|\ | | | | | | | | | | | | | | | | fa8c04b421 Tests/RunCMake/execute_process: Check STARTUPINFOW reserved members d98df689ab Merge branch 'libuv-win-process-no-extra-stdio' a590382850 libuv: win/spawn: disable extra-file-descriptor support not needed by CMake Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9541
| * Tests/RunCMake/execute_process: Check STARTUPINFOW reserved membersBrad King2024-05-242-0/+5
| | | | | | | | | | | | | | | | Verify that `execute_process` launches processes on Windows such that `GetStartupInfoW` in the child does not populate `STARTUPINFOW` members reserved for the MSVC C run-time. Issue: #25996
* | Tests: Cover execute_process with abnormal exit on all platformsBrad King2024-05-146-16/+11
|/ | | | | | | Use a dedicated helper program instead of a Python script. This also avoids an interactive popup on macOS. Fixes: #25973
* Tests: Add case to cover execute_process support for no extension on WindowsKyle Edwards2023-11-306-0/+56
| | | | Issue: #25450
* execute_process(): Restore opening files relative to WORKING_DIRECTORYKyle Edwards2023-10-166-0/+22
| | | | | | | | Prior to 5420639a, execute_process() would open INPUT_FILE, OUTPUT_FILE, and ERROR_FILE relative to the WORKING_DIRECTORY argument if it was provided. Restore this behavior for backwards compatibility. Fixes: #25338
* cmExecuteProcessCommand: Replace cmsysProcess with cmUVProcessChainKyle Edwards2023-08-294-0/+4
|
* cmExecuteProcessCommand: Report keyword errors via argument parser resultsBrad King2022-07-222-2/+7
|
* CMake: Use FindPython instead of FindPythonInterp to build CMake itselfKyle Edwards2022-04-214-9/+9
| | | | Fixes: #23444
* execute_process: Improve COMMAND_ERROR_IS_FATAL error capture scenariosAsit Dhal2020-12-1020-10/+126
| | | | | | | | | | | 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-0110-0/+32
| | | | Fixes: #19930
* execute_process: Add ECHO_(OUTPUT|ERROR)_VARIABLE optionsCristian Adam2020-02-245-0/+31
| | | | Fixes: #20378
* execute_process: Add option to echo command linesBill Hoffman2019-04-1910-0/+88
| | | | | | | | | | 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: Allow UTF-8 as a synonym for the UTF8 keywordCraig Scott2017-12-272-0/+2
| | | | | | | | UTF-8 is the proper naming according to the UTF-8 RFC and is also the name used for a similar keyword in the file() command. This commit brings (backward compatible) consistency to the keyword names and allows the standard UTF-8 name to be used with execute_process(). The old UTF8 keyword is still supported.
* execute_process: Add option to get results of every childAdam Weisi2017-06-103-0/+138
| | | | | Add a `RESULTS_VARIABLE` option to get the results of all children in a pipeline of one or more `COMMAND`s.
* execute_process: Add ENCODING option for Windows child process outputDāvis Mosāns2016-11-307-0/+21
| | | | Different applications can use different output encodings.
* execute_process: Improve stdout/stderr mergingBrad King2015-05-077-0/+55
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.