aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2023-08-15 20:55:38 +0200
committerTim Jenssen <tim.jenssen@qt.io>2023-08-15 18:57:48 +0000
commit91a931dd218fe18ab77bd2b17127c3a52d5f4db1 (patch)
tree8c40f72aaae3dc4c032a6f3403c5cae0196e89d6
parent0f7462ad24fbeac755b3cc893138f9cbf5be1f99 (diff)
QmlDesigner: build it only if Qt is GREATER_EQUAL 6.4.3
Change-Id: Iccd05a7d4f4ace47fd9398bdc78584e3919ec595 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r--CMakeLists.txt10
-rw-r--r--src/plugins/qmldesigner/CMakeLists.txt4
-rw-r--r--src/plugins/qmlpreview/CMakeLists.txt18
-rw-r--r--src/plugins/qmlpreview/qmldebugtranslationclient.cpp7
-rw-r--r--tests/unit/tools/CMakeLists.txt4
5 files changed, 12 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 55bf2bfca8..c82f017c8e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,8 +36,6 @@ qtc_link_with_qt()
option(WITH_TESTS "Build Tests" ${ENV_QTC_WITH_TESTS})
add_feature_info("Build tests" ${WITH_TESTS} "")
-option(WITH_QMLDESIGNER "Build QmlDesigner" ${ENV_QTC_WITH_QMLDESIGNER})
-add_feature_info("Build QmlDesigner and related code" ${WITH_QMLDESIGNER} "")
option(WITH_DEBUG_CMAKE "Enabled CMake project debugging functionality" OFF)
option(SHOW_BUILD_DATE "Show build date in about dialog" OFF)
option(WITH_SANITIZE "Build with sanitizer enabled" OFF)
@@ -73,6 +71,14 @@ find_package(Qt6
COMPONENTS Concurrent Core Gui Network PrintSupport Qml Sql Widgets Xml Core5Compat ${QT_TEST_COMPONENT}
REQUIRED
)
+
+if (Qt6_VERSION VERSION_LESS_EQUAL 6.4.3)
+ option(WITH_QMLDESIGNER "Build QmlDesigner" OFF)
+else()
+ option(WITH_QMLDESIGNER "Build QmlDesigner" ${ENV_QTC_WITH_QMLDESIGNER})
+endif()
+add_feature_info("Build QmlDesigner and related code (only if Qt is 6.4.3 or newer)" ${WITH_QMLDESIGNER} "")
+
# hack for Qbs which still supports Qt5 and Qt6
if (TARGET Qt6::Core5CompatPrivate)
if (CMAKE_VERSION VERSION_LESS 3.18)
diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt
index 409bf10c3f..2320b4d76f 100644
--- a/src/plugins/qmldesigner/CMakeLists.txt
+++ b/src/plugins/qmldesigner/CMakeLists.txt
@@ -37,7 +37,7 @@ extend_qtc_library(QmlDesignerUtils
)
add_qtc_library(QmlDesignerCore STATIC
- CONDITION Qt6_VERSION VERSION_GREATER_EQUAL 6.4.3 AND TARGET QmlDesignerBase AND TARGET Qt6::QmlPrivate AND TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate
+ CONDITION TARGET QmlDesignerBase AND TARGET Qt6::QmlPrivate AND TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate
EXCLUDE_FROM_INSTALL
PROPERTIES SKIP_AUTOUIC ON
DEPENDS
@@ -428,7 +428,7 @@ extend_qtc_library(QmlDesignerCore
add_qtc_plugin(QmlDesigner
PLUGIN_RECOMMENDS QmlPreview
- CONDITION Qt6_VERSION VERSION_GREATER_EQUAL 6.4.3 AND TARGET QmlDesignerCore AND TARGET Qt::QuickWidgets AND TARGET Qt::Svg
+ CONDITION TARGET QmlDesignerCore AND TARGET Qt::QuickWidgets AND TARGET Qt::Svg
PLUGIN_DEPENDS
Core ProjectExplorer QmlDesignerBase QmlJSEditor QmakeProjectManager QmlProjectManager
QtSupport
diff --git a/src/plugins/qmlpreview/CMakeLists.txt b/src/plugins/qmlpreview/CMakeLists.txt
index 40114a7e47..4c1889143a 100644
--- a/src/plugins/qmlpreview/CMakeLists.txt
+++ b/src/plugins/qmlpreview/CMakeLists.txt
@@ -1,7 +1,7 @@
add_qtc_plugin(QmlPreview
CONDITION TARGET QmlProjectManager
PUBLIC_DEPENDS QmlDebug
- DEPENDS QmlJS
+ DEPENDS QmlJS Qt::QmlPrivate
PLUGIN_DEPENDS
Core ProjectExplorer QmlJSTools QtSupport
ResourceEditor QmlProjectManager
@@ -22,19 +22,3 @@ extend_qtc_plugin(QmlPreview
tests/qmlpreviewclient_test.cpp tests/qmlpreviewclient_test.h
tests/qmlpreviewplugin_test.cpp tests/qmlpreviewplugin_test.h
)
-
-if(TARGET Qt6::QmlPrivate)
- get_target_property(qmldebugprivate_include_directories
- Qt6::QmlPrivate
- INTERFACE_INCLUDE_DIRECTORIES
- )
- find_file(have_qml_debug_translation_protocol
- NAMES private/qqmldebugtranslationprotocol_p.h
- PATHS ${qmldebugprivate_include_directories}
- )
- extend_qtc_plugin(QmlPreview
- CONDITION have_qml_debug_translation_protocol
- PUBLIC_DEPENDS Qt::QmlPrivate
- PUBLIC_DEFINES "FOUND_QML_DEBUG_TRANSLATION_PROTOCOL"
- )
-endif()
diff --git a/src/plugins/qmlpreview/qmldebugtranslationclient.cpp b/src/plugins/qmlpreview/qmldebugtranslationclient.cpp
index d0cfc2d96e..fc3018018e 100644
--- a/src/plugins/qmlpreview/qmldebugtranslationclient.cpp
+++ b/src/plugins/qmlpreview/qmldebugtranslationclient.cpp
@@ -6,9 +6,7 @@
#include <QUrl>
-#ifdef FOUND_QML_DEBUG_TRANSLATION_PROTOCOL
#include <private/qqmldebugtranslationprotocol_p.h>
-#endif
namespace QmlPreview {
@@ -20,14 +18,9 @@ QmlDebugTranslationClient::QmlDebugTranslationClient(QmlDebug::QmlDebugConnectio
void QmlDebugTranslationClient::changeLanguage(const QUrl &url, const QString &localeIsoCode)
{
QmlDebug::QPacket packet(dataStreamVersion());
-#ifdef FOUND_QML_DEBUG_TRANSLATION_PROTOCOL
- sendMessage(QQmlDebugTranslation::createChangeLanguageRequest(packet, url, localeIsoCode));
-#else
const int request_change_language = 1;
packet << request_change_language << url << localeIsoCode;
sendMessage(packet.data());
-#endif
-
}
void QmlDebugTranslationClient::stateChanged(QmlDebug::QmlDebugClient::State state)
diff --git a/tests/unit/tools/CMakeLists.txt b/tests/unit/tools/CMakeLists.txt
index 123825fe81..05b561491f 100644
--- a/tests/unit/tools/CMakeLists.txt
+++ b/tests/unit/tools/CMakeLists.txt
@@ -1,3 +1 @@
-if (Qt6_Version VERSION_GREATER_EQUAL "6.4.3")
- add_subdirectory(qmlprojectmanager)
-endif ()
+add_subdirectory(qmlprojectmanager)