CTestTargets: Include CMAKE_CTEST_ARGUMENTS in CTEST_TEST_TARGET_ALIAS

Extend the change from commit 4153d8445b (Add CMAKE_CTEST_ARGUMENTS
variable to pass command-line arguments to ctest, 2019-12-28,
v3.17.0-rc1~150^2) to cover the test target alias created by
`CTEST_TEST_TARGET_ALIAS` too.

This should allow:

    set(CMAKE_CTEST_ARGUMENTS -T Test --no-compress-output)
    set(CTEST_TEST_TARGET_ALIAS runtests)
    include(CTest)

to use the arguments as part of `make runtests`.

Fixes: #22239
This commit is contained in:
Cody Martin
2022-08-26 14:41:52 -04:00
committed by Brad King
parent bbda95e7bd
commit a79ccf7188

View File

@@ -86,7 +86,7 @@ if(NOT _CTEST_TARGETS_ADDED)
# or "RUN_TESTS" target:
if(CTEST_TEST_TARGET_ALIAS)
add_custom_target(${CTEST_TEST_TARGET_ALIAS}
${CMAKE_CTEST_COMMAND} ${__conf_types}
${CMAKE_CTEST_COMMAND} ${CMAKE_CTEST_ARGUMENTS} ${__conf_types}
USES_TERMINAL
)
endif()