Set qt_add_test WORKING_DIRECTORY to OUTPUT_DIRECTORY

If qt_add_test() is called with OUTPUT_DIRECTORY and no
WORKING_DIRECTORY is specified, default the WORKING_DIRECTORY to the
same value as OUTPUT_DIRECTORY._

Change-Id: If373fe590508ad58d4632e0598cd0d9dddb2ae16
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Leander Beernaert 2020-02-12 17:19:17 +01:00
parent e9672c747c
commit ba165cae71

View File

@ -2724,6 +2724,8 @@ function(qt_add_test name)
else()
if (arg_WORKING_DIRECTORY)
set(test_working_dir "${arg_WORKING_DIRECTORY}")
elseif(arg_OUTPUT_DIRECTORY)
set(test_working_dir "${arg_OUTPUT_DIRECTORY}")
else()
set(test_working_dir "${CMAKE_CURRENT_BINARY_DIR}")
endif()