From f43ac65ccb0be1b34cc6a31906a677ab0e07efa6 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 2 Jul 2021 17:27:40 +0200 Subject: [PATCH] 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 --- src/libs/tracing/CMakeLists.txt | 4 ++++ src/plugins/perfprofiler/CMakeLists.txt | 4 ++++ src/plugins/qmlprofiler/CMakeLists.txt | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/libs/tracing/CMakeLists.txt b/src/libs/tracing/CMakeLists.txt index 4ebc77b913c..cb46eb21b03 100644 --- a/src/libs/tracing/CMakeLists.txt +++ b/src/libs/tracing/CMakeLists.txt @@ -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 diff --git a/src/plugins/perfprofiler/CMakeLists.txt b/src/plugins/perfprofiler/CMakeLists.txt index 3c0ce3e434a..f7f6c91aa04 100644 --- a/src/plugins/perfprofiler/CMakeLists.txt +++ b/src/plugins/perfprofiler/CMakeLists.txt @@ -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 diff --git a/src/plugins/qmlprofiler/CMakeLists.txt b/src/plugins/qmlprofiler/CMakeLists.txt index 7dc0cecb9dc..295bc3d0bb9 100644 --- a/src/plugins/qmlprofiler/CMakeLists.txt +++ b/src/plugins/qmlprofiler/CMakeLists.txt @@ -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 )