Consider CMAKE_RUNTIME_OUTPUT_DIRECTORY in tests and benchmarks

Consider CMAKE_RUNTIME_OUTPUT_DIRECTORY when setting the default
OUTPUT_DIRECTORY for tests and benchmarks.

Change-Id: I93d85c77f30fec186e13e8cd3e902027e60c588f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Alexey Edelev 2023-10-30 10:12:43 +01:00
parent db6f7908d0
commit 1a4659b081

View File

@ -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