mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
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
14 lines
481 B
CMake
14 lines
481 B
CMake
file(MAKE_DIRECTORY dir)
|
|
file(WRITE dir/in.txt "This is a test")
|
|
execute_process(COMMAND ${PRINT_STDIN_EXE} WORKING_DIRECTORY dir INPUT_FILE in.txt OUTPUT_FILE out.txt ERROR_FILE err.txt)
|
|
if(NOT EXISTS dir/out.txt)
|
|
message(SEND_ERROR "Did not create dir/out.txt")
|
|
endif()
|
|
file(READ dir/out.txt out)
|
|
if(NOT out STREQUAL "This is a test")
|
|
message(SEND_ERROR "Did not read dir/in.txt")
|
|
endif()
|
|
if(NOT EXISTS dir/err.txt)
|
|
message(SEND_ERROR "Did not create dir/err.txt")
|
|
endif()
|