diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2022-02-08 15:25:52 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-09 14:56:09 +0000 |
commit | 8dd4a26bca1ae36a0fd05ea17951ce2ef80291c4 (patch) | |
tree | 45f3d2a6fb7e8fe9c3dc56ec96b78aee856392ff /cmake | |
parent | b1a1d6ce714f4badb6156d7487b647967e060c4a (diff) |
Fix the run of _check targets in multi-config builds
With Ninja Multi-Config generator it's necessary to provide the
'-C' option matching the build configuration when running
ctest. This patchset adds the missing option to the command line
of the '_check' targets.
Change-Id: I42acfba26a09877a6d3a5be9230860f15f95a0cd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3bee7db4198712c763dbd754bad7b2c851147038)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtTestHelpers.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index f15bd07b44..37ef586d7e 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -346,10 +346,16 @@ function(qt_internal_add_test name) endif() # Add a ${target}/check makefile target, to more easily test one test. + + set(test_config_options "") + get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG) + if(is_multi_config) + set(test_config_options -C $<CONFIG>) + endif() add_custom_target("${name}_check" VERBATIM - COMMENT "Running ${CMAKE_CTEST_COMMAND} -V -R \"^${name}$\"" - COMMAND "${CMAKE_CTEST_COMMAND}" -V -R "^${name}$" + COMMENT "Running ${CMAKE_CTEST_COMMAND} -V -R \"^${name}$\" ${test_config_options}" + COMMAND "${CMAKE_CTEST_COMMAND}" -V -R "^${name}$" ${test_config_options} ) if(TARGET "${name}") add_dependencies("${name}_check" "${name}") |