From dc4159286b8571a3f3543e457fe1b51b9f5965b7 Mon Sep 17 00:00:00 2001 From: Orkun Tokdemir Date: Fri, 21 Jul 2023 16:41:48 +0200 Subject: qt6_wrap_cpp: Add .moc generation When a `.moc` file is included in a source file and that source passed to `qt_wrap_cpp`, Users should add the generated `.moc`s path to the target's include path. Since we don't share anything about the output path of generated files by `qt_wrap_cpp`, it makes sense to add in inside `qt_wrap_cpp`. And also, the generated `.moc` file is added to target's source to complete the dependency graph. Otherwise, Users need to get output variable and pass it to target's sources. * Update docs * Add test [ChangeLog][Build System] qt_wrap_cpp will accept .cpp files from now on. When .cpp a file is passed to qt_wrap_cpp, TARGET parameter becomes required. Generated .moc files are added to target's sources inside qt_wrap_cpp. That's why the output parameter will not contain generated .moc files. Fixes: QTBUG-113402 Change-Id: I54dd2b1ff8e5c9ba457b1eb4f73b0a8190d9c659 Reviewed-by: Alexandru Croitor Reviewed-by: Joerg Bornemann --- tests/auto/cmake/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto/cmake/CMakeLists.txt') diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 3fe358cd0b..b8d8f50d6b 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -197,6 +197,7 @@ endif() _qt_internal_test_expect_pass(test_add_resource_prefix BINARY test_add_resource_prefix) _qt_internal_test_expect_build_fail(test_add_resource_options) _qt_internal_test_expect_build_fail(test_wrap_cpp_options) +_qt_internal_test_expect_pass(test_wrap_cpp_moc) _qt_internal_test_expect_pass(test_platform_defs_include) _qt_internal_test_expect_pass(test_qtmainwin_library) -- cgit v1.2.3