From 1a4659b081aa187406c2abe14277f154f9ee7a95 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 30 Oct 2023 10:12:43 +0100 Subject: [PATCH] Consider CMAKE_RUNTIME_OUTPUT_DIRECTORY in tests and benchmarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consider CMAKE_RUNTIME_OUTPUT_DIRECTORY when setting the default OUTPUT_DIRECTORY for tests and benchmarks. Change-Id: I93d85c77f30fec186e13e8cd3e902027e60c588f Reviewed-by: Tor Arne Vestbø --- cmake/QtTestHelpers.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 2de151cf55..991c38bc57 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -31,7 +31,11 @@ function(qt_internal_add_benchmark target) ) if(NOT arg_OUTPUT_DIRECTORY) - set(arg_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + if(CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(arg_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + else() + set(arg_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + endif() endif() qt_internal_library_deprecation_level(deprecation_define) @@ -477,8 +481,12 @@ function(qt_internal_add_test name) endif() endif() - if (NOT arg_OUTPUT_DIRECTORY) - set(arg_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + if(NOT arg_OUTPUT_DIRECTORY) + if(CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(arg_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + else() + set(arg_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + endif() endif() set(private_includes