Add feature to disable QmlDesigner and related files

QTC_WITH_QMLDESIGNER or WITH_QMLDESIGNER has to be set to OFF to disable
QmlDesigner related code.

Change-Id: I7e25200fe856fcc7de3493cfa394cdd4f923e0bf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Marco Bubke
2023-04-19 10:11:38 +02:00
parent 4393df48be
commit 2694d6a1f5
8 changed files with 146 additions and 119 deletions

View File

@@ -6,6 +6,7 @@ include(Utils)
env_with_default("QTC_BUILD_WITH_PCH" ENV_QTC_BUILD_WITH_PCH ON)
env_with_default("QTC_WITH_TESTS" ENV_QTC_WITH_TESTS OFF)
env_with_default("QTC_WITH_QMLDESIGNER" ENV_QTC_WITH_QMLDESIGNER ON)
option(BUILD_WITH_PCH "Build with precompiled headers" "${ENV_QTC_BUILD_WITH_PCH}")
@@ -35,6 +36,8 @@ 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)

View File

@@ -7,7 +7,8 @@
"generator": "Ninja",
"cacheVariables": {
"BUILD_PLUGINS": "Core;Designer;DiffEditor;TextEditor;ProjectExplorer;CppEditor;CodePaster;Docker;Git;Help;QmakeProjectManager;CMakeProjectManager;ClangCodeModel;ClangTools;ClangFormat;Debugger;QtSupport;ResourceEditor;VcsBase;Welcome;LanguageClient;RemoteLinux",
"BUILD_EXECUTABLES": "QtCreator;qtcreator_ctrlc_stub;qtcreator_process_stub;win64interrupt;qtcreator_processlauncher"
"BUILD_EXECUTABLES": "QtCreator;qtcreator_ctrlc_stub;qtcreator_process_stub;win64interrupt;qtcreator_processlauncher",
"WITH_QMLDESIGNER": "OFF"
}
}
]

View File

@@ -13,9 +13,11 @@ add_subdirectory(qmldebug)
add_subdirectory(qmleditorwidgets)
add_subdirectory(glsl)
add_subdirectory(languageserverprotocol)
add_subdirectory(sqlite)
if (WITH_QMLDESIGNER)
add_subdirectory(sqlite)
add_subdirectory(qmlpuppetcommunication)
endif()
add_subdirectory(tracing)
add_subdirectory(qmlpuppetcommunication)
add_subdirectory(qtcreatorcdbext)

View File

@@ -57,15 +57,18 @@ add_subdirectory(scxmleditor)
add_subdirectory(subversion)
add_subdirectory(compilationdatabaseprojectmanager)
add_subdirectory(languageclient)
add_subdirectory(qmldesignerbase)
if (WITH_QMLDESIGNER)
add_subdirectory(qmldesignerbase)
endif()
# Level 6:
add_subdirectory(cmakeprojectmanager)
add_subdirectory(debugger)
add_subdirectory(coco)
add_subdirectory(gitlab)
add_subdirectory(qmlprojectmanager)
if (WITH_QMLDESIGNER)
add_subdirectory(qmlprojectmanager)
endif()
# Level 7:
add_subdirectory(android)
@@ -90,15 +93,17 @@ add_subdirectory(squish)
# Level 8:
add_subdirectory(boot2qt)
unset(qmldesigner_builddir)
if (WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (WITH_QMLDESIGNER)
unset(qmldesigner_builddir)
if (WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Workaround for @CMakeFiles\QmlDesigner.rsp ld.lld.exe: The filename or extension is too long.
# Clang on Windows is having problems with QmlDesigner.rsp which is bigger than 32KiB
set(qmldesigner_builddir ${PROJECT_BINARY_DIR}/qmldsgnr)
endif()
add_subdirectory(qmldesigner ${qmldesigner_builddir})
add_subdirectory(studiowelcome)
add_subdirectory(insight)
endif()
add_subdirectory(qmldesigner ${qmldesigner_builddir})
add_subdirectory(studiowelcome)
add_subdirectory(insight)
add_subdirectory(qnx)
add_subdirectory(webassembly)
add_subdirectory(mcusupport)

View File

@@ -5,8 +5,8 @@
#include "insightmodel.h"
#include "insightview.h"
#include <componentcore/theme.h>
#include <designersettings.h>
#include <theme.h>
#include <qmldesignerconstants.h>
#include <qmldesignerplugin.h>

View File

@@ -1,16 +1,5 @@
#only if the plugin is requested by qtc_plugin_enabled continue if not stop as early as possible
add_qtc_plugin(QmlDesigner
PLUGIN_RECOMMENDS QmlPreview
CONDITION Qt6_VERSION VERSION_GREATER_EQUAL 6.2.0 AND TARGET Qt::QuickWidgets AND TARGET Qt::Svg
PROPERTIES COMPILE_WARNING_AS_ERROR ON
PLUGIN_DEPENDS
Core ProjectExplorer QmlDesignerBase QmlJSEditor QmakeProjectManager QmlProjectManager
QtSupport
)
qtc_plugin_enabled(_qmlDesignerEnabled QmlDesigner)
if (NOT _qmlDesignerEnabled)
return()
endif()
find_package(Qt6 COMPONENTS QmlDomPrivate QmlCompilerPrivate)
@@ -19,7 +8,6 @@ if (APPLE)
set(QmlDesignerPluginInstallPrefix "${IDE_PLUGIN_PATH}/QmlDesigner")
endif()
env_with_default("QDS_USE_PROJECTSTORAGE" ENV_QDS_USE_PROJECTSTORAGE OFF)
option(USE_PROJECTSTORAGE "Use ProjectStorage" ${ENV_QDS_USE_PROJECTSTORAGE})
add_feature_info("ProjectStorage" ${USE_PROJECTSTORAGE} "")
@@ -434,15 +422,17 @@ extend_qtc_library(QmlDesignerCore
file(GLOB PROJECTSTORAGE_EXCLUDED_SOURCES designercore/projectstorage/*.cpp)
set_property(SOURCE ${PROJECTSTORAGE_EXCLUDED_SOURCES} PROPERTY SKIP_AUTOMOC ON)
extend_qtc_plugin(QmlDesigner
PUBLIC_DEPENDS
QmlDesignerUtils
QmlDesignerBase
QmlPuppetCommunication
add_qtc_plugin(QmlDesigner
PLUGIN_RECOMMENDS QmlPreview
CONDITION Qt6_VERSION VERSION_GREATER_EQUAL 6.2.0 AND TARGET Qt::QuickWidgets AND TARGET Qt::Svg
PLUGIN_DEPENDS
Core ProjectExplorer QmlDesignerBase QmlJSEditor QmakeProjectManager QmlProjectManager
QtSupport
DEPENDS
QmlDesignerCore
QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem Sqlite
Qt::QuickWidgets Qt::CorePrivate Qt::Xml Qt::Svg
QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem
Qt::QuickWidgets Qt::CorePrivate Qt::Xml Qt::Svg QmlDesignerCore Sqlite
PUBLIC_DEPENDS
QmlDesignerUtils QmlPuppetCommunication QmlDesignerBase
DEFINES
IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\"
SHARE_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../../../share/qtcreator/qmldesigner"
@@ -548,87 +538,6 @@ if (QTC_STATIC_BUILD AND TARGET QmlDesigner)
extend_qtc_target(QmlDesigner PUBLIC_DEPENDS TextEditor)
endif()
add_qtc_plugin(assetexporterplugin
PLUGIN_CLASS AssetExporterPlugin
CONDITION TARGET QmlDesigner
DEPENDS Core ProjectExplorer QmlDesigner Utils Qt::Qml Qt::QuickPrivate
PUBLIC_INCLUDES assetexporterplugin
SOURCES
assetexporterplugin/assetexportdialog.h assetexporterplugin/assetexportdialog.cpp assetexporterplugin/assetexportdialog.ui
assetexporterplugin/assetexporter.h assetexporterplugin/assetexporter.cpp
assetexporterplugin/assetexporterplugin.h assetexporterplugin/assetexporterplugin.cpp
assetexporterplugin/assetexporterview.h assetexporterplugin/assetexporterview.cpp
assetexporterplugin/assetexportpluginconstants.h
assetexporterplugin/componentexporter.h assetexporterplugin/componentexporter.cpp
assetexporterplugin/exportnotification.h assetexporterplugin/exportnotification.cpp
assetexporterplugin/filepathmodel.h assetexporterplugin/filepathmodel.cpp
assetexporterplugin/dumpers/assetnodedumper.h assetexporterplugin/dumpers/assetnodedumper.cpp
assetexporterplugin/dumpers/itemnodedumper.h assetexporterplugin/dumpers/itemnodedumper.cpp
assetexporterplugin/dumpers/nodedumper.h assetexporterplugin/dumpers/nodedumper.cpp
assetexporterplugin/dumpers/textnodedumper.h assetexporterplugin/dumpers/textnodedumper.cpp
assetexporterplugin/assetexporterplugin.qrc
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
)
extend_qtc_plugin(assetexporterplugin
CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
add_qtc_plugin(componentsplugin
PLUGIN_CLASS ComponentsPlugin
CONDITION TARGET QmlDesigner
DEPENDS Core QmlDesigner Utils Qt::Qml
DEFINES COMPONENTS_LIBRARY
SOURCES
componentsplugin/addtabdesigneraction.cpp componentsplugin/addtabdesigneraction.h
componentsplugin/addtabtotabviewdialog.cpp componentsplugin/addtabtotabviewdialog.h
componentsplugin/addtabtotabviewdialog.ui
componentsplugin/componentsplugin.cpp componentsplugin/componentsplugin.h
componentsplugin/componentsplugin.qrc
componentsplugin/entertabdesigneraction.cpp componentsplugin/entertabdesigneraction.h
componentsplugin/tabviewindexmodel.cpp componentsplugin/tabviewindexmodel.h
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
)
extend_qtc_plugin(componentsplugin
CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
add_qtc_plugin(qmlpreviewplugin
PLUGIN_CLASS QmlPreviewWidgetPlugin
CONDITION TARGET QmlDesigner
DEPENDS Core ProjectExplorer QmlDesigner Utils Qt::Qml
SOURCES
qmlpreviewplugin/qmlpreviewactions.cpp qmlpreviewplugin/qmlpreviewactions.h
qmlpreviewplugin/qmlpreviewplugin.cpp qmlpreviewplugin/qmlpreviewplugin.h
qmlpreviewplugin/qmlpreviewplugin.qrc
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
)
extend_qtc_plugin(qmlpreviewplugin
CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
add_qtc_plugin(qtquickplugin
PLUGIN_CLASS QtQuickPlugin
CONDITION TARGET QmlDesigner
DEPENDS Core QmlDesigner Utils Qt::Qml
DEFINES QTQUICK_LIBRARY
SOURCES
qtquickplugin/qtquickplugin.cpp qtquickplugin/qtquickplugin.h
qtquickplugin/qtquickplugin.qrc
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
)
extend_qtc_plugin(qtquickplugin
CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
add_subdirectory(studioplugin)
extend_qtc_plugin(QmlDesigner
SOURCES_PREFIX components
@@ -1178,3 +1087,106 @@ extend_qtc_plugin(QmlDesigner
CONDITION TARGET Nanotrace
DEPENDS Nanotrace
)
add_qtc_plugin(assetexporterplugin
PLUGIN_CLASS AssetExporterPlugin
CONDITION TARGET QmlDesigner
PLUGIN_DEPENDS
Core ProjectExplorer QmlDesigner
DEPENDS Utils Qt::Qml Qt::QuickPrivate
PUBLIC_INCLUDES assetexporterplugin
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
)
extend_qtc_plugin(assetexporterplugin
CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
extend_qtc_plugin(assetexporterplugin
SOURCES_PREFIX assetexporterplugin
SOURCES
assetexportdialog.h assetexportdialog.cpp assetexportdialog.ui
assetexporter.h assetexporter.cpp
assetexporterplugin.h assetexporterplugin.cpp
assetexporterview.h assetexporterview.cpp
assetexportpluginconstants.h
componentexporter.h componentexporter.cpp
exportnotification.h exportnotification.cpp
filepathmodel.h filepathmodel.cpp
dumpers/assetnodedumper.h dumpers/assetnodedumper.cpp
dumpers/itemnodedumper.h dumpers/itemnodedumper.cpp
dumpers/nodedumper.h dumpers/nodedumper.cpp
dumpers/textnodedumper.h dumpers/textnodedumper.cpp
assetexporterplugin.qrc
)
add_qtc_plugin(componentsplugin
PLUGIN_CLASS ComponentsPlugin
CONDITION TARGET QmlDesigner
PLUGIN_DEPENDS Core QmlDesigner
DEPENDS Utils Qt::Qml
DEFINES COMPONENTS_LIBRARY
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
)
extend_qtc_plugin(componentsplugin
CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
extend_qtc_plugin(componentsplugin
SOURCES_PREFIX componentsplugin
SOURCES
addtabdesigneraction.cpp addtabdesigneraction.h
addtabtotabviewdialog.cpp addtabtotabviewdialog.h
addtabtotabviewdialog.ui
componentsplugin.cpp componentsplugin.h
componentsplugin.qrc
entertabdesigneraction.cpp entertabdesigneraction.h
tabviewindexmodel.cpp tabviewindexmodel.h
)
add_qtc_plugin(qmlpreviewplugin
PLUGIN_CLASS QmlPreviewWidgetPlugin
CONDITION TARGET QmlDesigner
PLUGIN_DEPENDS Core ProjectExplorer QmlDesigner
DEPENDS Utils Qt::Qml
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
)
extend_qtc_plugin(qmlpreviewplugin
CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
extend_qtc_plugin(qmlpreviewplugin
SOURCES_PREFIX qmlpreviewplugin
SOURCES
qmlpreviewactions.cpp qmlpreviewactions.h
qmlpreviewplugin.cpp qmlpreviewplugin.h
qmlpreviewplugin.qrc
)
add_qtc_plugin(qtquickplugin
PLUGIN_CLASS QtQuickPlugin
CONDITION TARGET QmlDesigner
PLUGIN_DEPENDS Core QmlDesigner
DEPENDS Utils Qt::Qml
DEFINES QTQUICK_LIBRARY
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
)
extend_qtc_plugin(qtquickplugin
CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
extend_qtc_plugin(qtquickplugin
SOURCES_PREFIX qtquickplugin
SOURCES
qtquickplugin.cpp qtquickplugin.h
qtquickplugin.qrc
)
add_subdirectory(studioplugin)

View File

@@ -30,7 +30,9 @@ if (APPLE)
endif()
add_subdirectory(processlauncher)
add_subdirectory(qml2puppet)
if (WITH_QMLDESIGNER)
add_subdirectory(qml2puppet)
endif()
add_subdirectory(qtcdebugger) ## windows only
# add_subdirectory(qtcrashhandler)
add_subdirectory(qtc-askpass)

View File

@@ -1,4 +1,6 @@
add_subdirectory(auto)
add_subdirectory(manual)
add_subdirectory(tools/qml-ast2dot)
add_subdirectory(unit)
if (WITH_QMLDESIGNER)
add_subdirectory(unit)
endif()