Don't call qt_add_qml_module with inexistent TARGET

If the passed TARGET does not exist (because it had been disabled in the
CMake configuration), qt_add_qml_module will create it for the user.
That created target is by itself incomplete and breaks the build.

So, don't call qt_add_qml_module with inexistent TARGET.

Fixes: QTCREATORBUG-25960
Change-Id: I646eb2176befb0fd5fe06e184ebd0cee32e18ab2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Alessandro Portale
2021-07-02 17:27:40 +02:00
parent baf222af3f
commit f43ac65ccb
3 changed files with 12 additions and 0 deletions

View File

@@ -47,6 +47,10 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
qml/tracing.qrc
)
else() # < Qt 6.2
if (NOT TARGET Tracing)
return()
endif()
set(TRACING_QML_FILES
qml/ButtonsBar.qml
qml/CategoryLabel.qml

View File

@@ -52,6 +52,10 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
perfprofiler.qrc
)
else() # < Qt 6.2
if (NOT TARGET PerfProfiler)
return()
endif()
qt_add_resources(PerfProfiler perfprofiler
PREFIX "/perfprofiler"
tracepoints.sh

View File

@@ -83,6 +83,10 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
qml/qmlprofiler.qrc
)
else() # < Qt 6.2
if (NOT TARGET QmlProfiler)
return()
endif()
set(QMLPROFILER_QML_FILES
qml/QmlProfilerFlameGraphView.qml
)