cmake build: Fix handling of test dependencies

Test dependencies are not "real" code dependencies, they just
declare that for testing the plugin the other plugin has to
be loaded, even though it is _not_ a code dependency.

Add PLUGIN_TEST_DEPENDS to add_qtc_plugin. We cannot assume
that the target exists at that point, so adapt the usual pattern.

Fixes: QTCREATORBUG-25024
Change-Id: I4165ff8df762309e0be0bfe9e8bedef796a3bf17
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-12-11 12:23:49 +01:00
parent ea4a53a1aa
commit 305ca7e434
9 changed files with 24 additions and 31 deletions

View File

@@ -1,13 +1,10 @@
if (WITH_TESTS)
set(TST_COMPONENT CppEditor)
endif()
add_qtc_plugin(Designer
CONDITION TARGET Qt5::DesignerComponents AND TARGET Qt5::Designer
DEPENDS designerintegrationv2
Qt5::Designer Qt5::PrintSupport Qt5::DesignerComponents
DEFINES CPP_ENABLED
PLUGIN_DEPENDS Core CppTools ProjectExplorer QtSupport ResourceEditor TextEditor ${TST_COMPONENT}
PLUGIN_DEPENDS Core CppTools ProjectExplorer QtSupport ResourceEditor TextEditor
PLUGIN_TEST_DEPENDS CppEditor
SOURCES
codemodelhelpers.cpp codemodelhelpers.h
cpp/formclasswizard.cpp cpp/formclasswizard.h