Fix top-level build with examples enabled

One of our examples depends on QtQuickTest, which has a public
dependency to QtTest. So the example does find_package(Qt6 COMPONENTS
QuickTest), which will end up calling find_dependency(QtTest). The
Qt6Test cmake config files will import the module's feature, which
requires the Qt6::Test target to exist. That however was not created
because we set the QT_NO_CREATE_TARGETS. So if we set that (which is
correct), then we do need to find Qt6::Test at the top-level.

Other modules shouldn't need this as they don't create modules that in
turn have a public dependency to testlib.

Change-Id: Ia82aaa2b2462feec81659c6e532d0a185e6819a6
Done-with: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Simon Hausmann 2019-09-17 16:47:03 +02:00
parent b1299f6a83
commit f6229fea92
1 changed files with 1 additions and 1 deletions

View File

@ -8,6 +8,6 @@ project(QtDeclarative
)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Gui Widgets Network
OPTIONAL_COMPONENTS Sql Concurrent)
OPTIONAL_COMPONENTS Sql Concurrent Test)
qt_build_repo()