From 8fa9a987ea7bb25ef96d325a8fbbb8031e9ada63 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 26 Mar 2019 19:59:06 +0100 Subject: [PATCH] Install test executables into $prefix/tests instead of $prefix/bin The install path takes into account the path structure of the source directory, so that not all tests are bunched up into /tests, but rather /tests/auto/foo/bar. Change-Id: I5e32d2e41ae8f095f4eac6654973508efd598df0 Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 956fbf9ad1..f7d12c96ef 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -826,6 +826,7 @@ endfunction() function(add_qt_test name) qt_parse_all_arguments(arg "add_qt_test" "RUN_SERIAL" "" "${__default_private_args}" ${ARGN}) set(path "${CMAKE_CURRENT_BINARY_DIR}") + file(RELATIVE_PATH test_relative_src_dir ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) add_qt_executable("${name}" OUTPUT_DIRECTORY "${path}" @@ -840,6 +841,7 @@ function(add_qt_test name) LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} + INSTALL_DIRECTORY ${test_relative_src_dir} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")