From ae0b648a853d5e4687f2f9d71c902856dcb3d42b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 20 Oct 2021 11:38:26 +0200 Subject: [PATCH] CMake build: Allow compilation without QtQuick Disable the parts that require it in that case. Change-Id: I3f62eb9b325905ea225009aad6b9020cef545da6 Reviewed-by: Cristian Adam --- CMakeLists.txt | 5 ++--- src/CMakeLists.txt | 3 ++- src/libs/tracing/CMakeLists.txt | 2 +- src/plugins/qmldesigner/CMakeLists.txt | 1 + src/plugins/studiowelcome/CMakeLists.txt | 1 + src/tools/qml2puppet/CMakeLists.txt | 1 + 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 162b0a9aeee..87be55233dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,8 +49,7 @@ endif() find_package(Qt5 ${IDE_QT_VERSION_MIN} - COMPONENTS Concurrent Core Gui Network PrintSupport Qml Quick - QuickWidgets Sql Widgets Xml Core5Compat ${QT_TEST_COMPONENT} + COMPONENTS Concurrent Core Gui Network PrintSupport Qml Sql Widgets Xml Core5Compat ${QT_TEST_COMPONENT} REQUIRED ) if (Qt5_VERSION VERSION_LESS 6.0.0) @@ -66,7 +65,7 @@ else() set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml_modules") endif() find_package(Qt5 COMPONENTS LinguistTools QUIET) -find_package(Qt5 COMPONENTS Designer DesignerComponents Help SerialPort Svg Tools QUIET) +find_package(Qt5 COMPONENTS Quick QuickWidgets Designer DesignerComponents Help SerialPort Svg Tools QUIET) option(BUILD_WITH_PCH "Build with precompiled headers" ON) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 799d8ef68c9..70dfa9b5f6e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,8 +51,9 @@ endif() include(CMakeFindDependencyMacro) find_dependency(Qt5 ${IDE_QT_VERSION_MIN} - COMPONENTS Concurrent Core Gui Widgets Core5Compat Network PrintSupport Qml Quick QuickWidgets Sql REQUIRED + COMPONENTS Concurrent Core Gui Widgets Core5Compat Network PrintSupport Qml Sql REQUIRED ) +find_dependency(Qt5 COMPONENTS Quick QuickWidgets QUIET) if (NOT IDE_VERSION) include(\${CMAKE_CURRENT_LIST_DIR}/QtCreatorIDEBranding.cmake) diff --git a/src/libs/tracing/CMakeLists.txt b/src/libs/tracing/CMakeLists.txt index 9378c0e4e02..c34f583810f 100644 --- a/src/libs/tracing/CMakeLists.txt +++ b/src/libs/tracing/CMakeLists.txt @@ -46,7 +46,7 @@ else() # < Qt 6.2 find_package(Qt6 COMPONENTS ShaderTools QUIET) add_qtc_library(Tracing - CONDITION TARGET Qt6::ShaderTools + CONDITION TARGET Qt6::ShaderTools AND TARGET Qt5::Quick FEATURE_INFO DEPENDS Utils Qt5::Qml Qt5::Quick PUBLIC_DEPENDS Qt5::Widgets diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index cee0c2e369f..0fe3867a7ef 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -4,6 +4,7 @@ if (APPLE) endif() add_qtc_plugin(QmlDesigner + CONDITION TARGET Qt5::QuickWidgets DEPENDS QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem Qt5::QuickWidgets Qt5::CorePrivate Sqlite diff --git a/src/plugins/studiowelcome/CMakeLists.txt b/src/plugins/studiowelcome/CMakeLists.txt index d22625e7c75..2ae3bdcc9a0 100644 --- a/src/plugins/studiowelcome/CMakeLists.txt +++ b/src/plugins/studiowelcome/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_plugin(StudioWelcome + CONDITION TARGET Qt5::QuickWidgets DEPENDS Qt5::QuickWidgets PLUGIN_DEPENDS Core ProjectExplorer QtSupport DEFINES STUDIO_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/qml/" diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt index 924e3a838c1..4606ee57082 100644 --- a/src/tools/qml2puppet/CMakeLists.txt +++ b/src/tools/qml2puppet/CMakeLists.txt @@ -97,6 +97,7 @@ extend_qtc_library(qml2puppet_static ) add_qtc_executable(qml2puppet + CONDITION TARGET Qt5::QuickPrivate DEPENDS Qt5::CorePrivate Qt5::Widgets Qt5::QmlPrivate Qt5::QuickPrivate Qt5::Network Qt5::GuiPrivate