diff options
author | Brad King <brad.king@kitware.com> | 2019-09-24 17:07:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-24 18:10:34 (GMT) |
commit | 0cfbd85e7b0d61affda6450b1cc081860b5543a6 (patch) | |
tree | 5cfde99a38c4d40381c70bf22d8b34fe4f20e1e0 /Tests/RunCMake/RunCMake.cmake | |
parent | 96541918c88c9a1647b44fbe07ca7d50e821a98a (diff) | |
download | CMake-0cfbd85e7b0d61affda6450b1cc081860b5543a6.zip CMake-0cfbd85e7b0d61affda6450b1cc081860b5543a6.tar.gz CMake-0cfbd85e7b0d61affda6450b1cc081860b5543a6.tar.bz2 |
Tests: Teach RunCMake to support a custom working directory
Diffstat (limited to 'Tests/RunCMake/RunCMake.cmake')
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index ce71677..644da60 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -82,9 +82,12 @@ function(run_cmake test) set(maybe_input_file "") endif() if(RunCMake_TEST_COMMAND) + if(NOT RunCMake_TEST_COMMAND_WORKING_DIRECTORY) + set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + endif() execute_process( COMMAND ${RunCMake_TEST_COMMAND} - WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" + WORKING_DIRECTORY "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}" OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result |