From d8a3b1daed4eff3cfe48d05642b42aeced9479ce Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 11 Sep 2024 10:47:58 +0200 Subject: [PATCH] QmlDesigner: Cleanup QmlDom requirements Change-Id: I6247388f6b685b71815d355f4768c823defcdc1f Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/CMakeLists.txt | 3 --- src/plugins/qmldesigner/libs/designercore/CMakeLists.txt | 8 +++++--- tests/unit/tests/unittests/projectstorage/CMakeLists.txt | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 0f0a0c70414..e6081e954de 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -1,8 +1,5 @@ #only if the plugin is requested by qtc_plugin_enabled continue if not stop as early as possible - -find_package(Qt6 COMPONENTS QmlDomPrivate QmlCompilerPrivate QUIET) - set(QmlDesignerPluginInstallPrefix "${IDE_PLUGIN_PATH}/qmldesigner") if (APPLE) set(QmlDesignerPluginInstallPrefix "${IDE_PLUGIN_PATH}/QmlDesigner") diff --git a/src/plugins/qmldesigner/libs/designercore/CMakeLists.txt b/src/plugins/qmldesigner/libs/designercore/CMakeLists.txt index fbca41645d5..977bced8f23 100644 --- a/src/plugins/qmldesigner/libs/designercore/CMakeLists.txt +++ b/src/plugins/qmldesigner/libs/designercore/CMakeLists.txt @@ -1,5 +1,8 @@ +if (IS_SUPPORTED_PROJECTSTORAGE_QT) + find_package(Qt6 COMPONENTS QmlDomPrivate QmlCompiler REQUIRED) +endif() + add_qtc_library(QmlDesignerCore - CONDITION TARGET Qt6::QmlPrivate AND TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate PROPERTIES SKIP_AUTOUIC ON DEPENDS Threads::Threads @@ -8,8 +11,6 @@ add_qtc_library(QmlDesignerCore Qt::Qml Qt::QmlPrivate Qt::Quick - Qt6::QmlDomPrivate - Qt6::QmlCompilerPrivate QmlJS TextEditorSupport QmlDesignerSettings @@ -63,6 +64,7 @@ extend_qtc_library(QmlDesignerCore extend_qtc_library(QmlDesignerCore CONDITION IS_SUPPORTED_PROJECTSTORAGE_QT + DEPENDS Qt6::QmlDomPrivate Qt6::QmlCompilerPrivate PUBLIC_DEFINES QDS_BUILD_QMLPARSER ) extend_qtc_library(QmlDesignerCore diff --git a/tests/unit/tests/unittests/projectstorage/CMakeLists.txt b/tests/unit/tests/unittests/projectstorage/CMakeLists.txt index 3e1e2850527..e9a3e08b5f8 100644 --- a/tests/unit/tests/unittests/projectstorage/CMakeLists.txt +++ b/tests/unit/tests/unittests/projectstorage/CMakeLists.txt @@ -11,7 +11,7 @@ extend_qtc_test(unittest ) extend_qtc_test(unittest - CONDITION TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate AND IS_SUPPORTED_PROJECTSTORAGE_QT + CONDITION IS_SUPPORTED_PROJECTSTORAGE_QT DEPENDS Qt6::QmlDomPrivate Qt6::QmlCompilerPrivate SOURCES qmldocumentparser-test.cpp @@ -19,7 +19,7 @@ extend_qtc_test(unittest ) extend_qtc_test(unittest - CONDITION TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate AND IS_SUPPORTED_PROJECTSTORAGE_QT + CONDITION IS_SUPPORTED_PROJECTSTORAGE_QT SOURCES_PREFIX "${QML_DESIGNER_DIRECTORY}/libs/designercore" DEPENDS Qt6::QmlDomPrivate Qt6::QmlCompilerPrivate DEFINES QDS_BUILD_QMLPARSER QML_DOM_MSVC2019_COMPAT # QML_DOM_MSVC2019_COMPAT can be revmoved for Qt 6.8