diff options
Diffstat (limited to 'tests/auto/tools/moc/CMakeLists.txt')
-rw-r--r-- | tests/auto/tools/moc/CMakeLists.txt | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/auto/tools/moc/CMakeLists.txt b/tests/auto/tools/moc/CMakeLists.txt index 44c9ee3fa9..1377c48306 100644 --- a/tests/auto/tools/moc/CMakeLists.txt +++ b/tests/auto/tools/moc/CMakeLists.txt @@ -1,10 +1,15 @@ -# special case skip regeneration -# Generated from moc.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_moc Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_moc LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() set(JSON_HEADERS backslash-newlines.h @@ -25,6 +30,7 @@ set(JSON_HEADERS moc_include.h namespace.h namespaced-flags.h + namespaced-base-class.h no-keywords.h non-gadget-parent-class.h oldstyle-casts.h @@ -38,6 +44,7 @@ set(JSON_HEADERS related-metaobjects-in-gadget.h related-metaobjects-in-namespaces.h related-metaobjects-name-conflict.h + signal-with-default-arg.h single-quote-digit-separator-n3781.h single_function_keyword.h slots-with-void-template.h @@ -78,7 +85,7 @@ qt_internal_add_test(tst_moc EXCEPTIONS ) -qt_internal_extend_target(tst_moc PUBLIC_LIBRARIES Qt::CorePrivate) +qt_internal_extend_target(tst_moc LIBRARIES Qt::CorePrivate) qt_internal_extend_target(tst_moc CONDITION CMAKE_CROSSCOMPILING DEFINES @@ -102,22 +109,22 @@ qt_internal_extend_target(tst_moc CONDITION CLANG OR GCC ) qt_internal_extend_target(tst_moc CONDITION TARGET Qt::DBus - PUBLIC_LIBRARIES + LIBRARIES Qt::DBus ) qt_internal_extend_target(tst_moc CONDITION TARGET Qt::Concurrent - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) qt_internal_extend_target(tst_moc CONDITION TARGET Qt::Network - PUBLIC_LIBRARIES + LIBRARIES Qt::Network ) qt_internal_extend_target(tst_moc CONDITION TARGET Qt::Sql - PUBLIC_LIBRARIES + LIBRARIES Qt::Sql ) @@ -142,4 +149,11 @@ add_custom_command(TARGET tst_moc -o "allmocs.json" --collect-json "@${moc_json_out}" COMMENT "Running moc with --collect-json" + VERBATIM +) + +# Add dependencies that are implicitly used inside the test +add_dependencies(tst_moc + Qt::qtpaths + Qt::moc ) |