Fixup: Add *_check build targets for auto cmake tests

- `PARSE_ARGV` should have been 1.
- `module_includes` target needs to be unique
  See gerrit comment of previous change, and
https://gitlab.kitware.com/cmake/cmake/-/issues/26580

Amends: 8f2f4ad4688df4963982c489c80b84e115cda29d

Task-number: QTBUG-98640
Change-Id: I82b85813f282ba1d5b4c938e59558e32647d4d86
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9f805b5bf7dc61a032a7ec79fd514c932103f1de)
(cherry picked from commit 1ae6883162351f7e6b983b2acf7886cce01ee153)
This commit is contained in:
Cristian Le 2025-01-16 16:24:02 +01:00
parent 55a1ef3ee3
commit a05d4402c1
2 changed files with 8 additions and 2 deletions

View File

@ -119,7 +119,7 @@ function(_qt_internal_make_check_target testname)
set(singleOpts CTEST_TEST_NAME)
set(multiOpts "")
cmake_parse_arguments(PARSE_ARGV 0 arg
cmake_parse_arguments(PARSE_ARGV 1 arg
"${options}" "${singleOpts}" "${multiOpts}"
)
if(NOT arg_CTEST_TEST_NAME)

View File

@ -781,5 +781,11 @@ function(_qt_internal_test_module_includes)
--build-options ${option_list}
)
_qt_internal_make_check_target(module_includes)
# We need a unique name for the targets
# TODO: CTest name clash would make multiple tests be run as long as they are
# defined in nested folders
string(TOLOWER "${PROJECT_NAME}" project_name_lower)
_qt_internal_make_check_target(${project_name_lower}_module_includes
CTEST_TEST_NAME module_includes
)
endfunction()