summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-11-12 15:31:34 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2019-11-12 14:46:44 +0000
commit681e8b4ead432b2658b0be9f90454bbdbd80d1b1 (patch)
tree3bda4360a4de69fa4012c02e991b291274b75b29 /cmake/QtBuild.cmake
parentf33069be243b08fef71e2681e1ed53a9bc6c89b6 (diff)
Add add_qt_manual_test()
This patch adds add_qt_manual_test() which is a simple wrapper around add_qt_executable() which does not build under ${CMAKE_BUILD_DIR}/bin or install the targets. This could potentially be used later to tag manual tests. Change-Id: Ic4e0a1d133009f5a858b9394347a0996cf42683f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake34
1 files changed, 34 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 31830b06b3..31a0e3f7c9 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -2390,6 +2390,40 @@ function(add_qt_benchmark target)
endfunction()
+# Simple wrapper around add_qt_executable for manual tests which insure that
+# the binary is built under ${CMAKE_CURRENT_BINARY_DIR} and never installed.
+# See add_qt_executable() for more details.
+function(add_qt_manual_test target)
+
+ qt_parse_all_arguments(arg "add_qt_benchmark"
+ "${__add_qt_executable_optional_args}"
+ "${__add_qt_executable_single_args}"
+ "${__add_qt_executable_multi_args}"
+ ${ARGN}
+ )
+
+ qt_remove_args(exec_args
+ ARGS_TO_REMOVE
+ ${target}
+ OUTPUT_DIRECTORY
+ INSTALL_DIRECTORY
+ ALL_ARGS
+ "${__add_qt_executable_optional_args}"
+ "${__add_qt_executable_single_args}"
+ "${__add_qt_executable_multi_args}"
+ ARGS
+ ${ARGV}
+ )
+
+ add_qt_executable(${target}
+ NO_INSTALL # we don't install benchmarks
+ OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" # avoid polluting bin directory
+ ${exec_args}
+ )
+
+endfunction()
+
+
# This function creates a CMake test target with the specified name for use with CTest.
function(add_qt_test name)
qt_parse_all_arguments(arg "add_qt_test"