From 5b6bf2914382696176ad664b7548dee1fd44f239 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 25 Nov 2022 19:02:16 +0100 Subject: [PATCH] CMake: Add a preset for a minimal CMake configuration This "cmake-plugin-minimal" preset contains the set of plugins that I usually need to build to be able to test the CMakeProjectManager plugin. Change-Id: I8bb02879df38c40be38c4a2bf4e85e0623f2dca5 Reviewed-by: Eike Ziller Reviewed-by: Reviewed-by: Qt CI Bot --- CMakePresets.json | 14 ++++++++++++++ src/plugins/qmldesigner/CMakeLists.txt | 25 ++++++++++++++++--------- src/tools/qml2puppet/CMakeLists.txt | 10 ++++++---- 3 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 CMakePresets.json diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 00000000000..2886bc7c125 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,14 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "cmake-plugin-minimal", + "displayName": "CMake, C++, Git, Debug minimal Build", + "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" + } + } + ] +} diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 5c7c6509eef..35fe948584b 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -1,3 +1,18 @@ +add_qtc_plugin(QmlDesigner + CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.2.0 AND TARGET Qt5::QuickWidgets AND TARGET Qt5::Svg + DEPENDS + QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem + Qt5::QuickWidgets Qt5::CorePrivate Sqlite Qt5::Xml Qt5::Svg + PLUGIN_DEPENDS + Core ProjectExplorer QmlJSEditor QmlProjectManager + QtSupport + PLUGIN_RECOMMENDS QmlPreview +) +qtc_plugin_enabled(_qmlDesignerEnabled QmlDesigner) +if (NOT _qmlDesignerEnabled) + return() +endif() + set(QmlDesignerPluginInstallPrefix "${IDE_PLUGIN_PATH}/qmldesigner") if (APPLE) set(QmlDesignerPluginInstallPrefix "${IDE_PLUGIN_PATH}/QmlDesigner") @@ -390,11 +405,7 @@ extend_qtc_library(QmlDesignerCore file(GLOB PROJECTSTORAGE_EXCLUDED_SOURCES designercore/projectstorage/*.cpp) set_property(SOURCE ${PROJECTSTORAGE_EXCLUDED_SOURCES} PROPERTY SKIP_AUTOMOC ON) -add_qtc_plugin(QmlDesigner - CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.2.0 AND TARGET Qt5::QuickWidgets AND TARGET Qt5::Svg - DEPENDS - QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem - Qt5::QuickWidgets Qt5::CorePrivate Sqlite Qt5::Xml Qt5::Svg +extend_qtc_plugin(QmlDesigner DEFINES IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\" SHARE_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../../../share/qtcreator/qmldesigner" @@ -418,10 +429,6 @@ add_qtc_plugin(QmlDesigner ${CMAKE_CURRENT_LIST_DIR} PUBLIC_DEPENDS QmlDesignerCore - PLUGIN_DEPENDS - Core ProjectExplorer QmlJSEditor QmakeProjectManager QmlProjectManager - QtSupport - PLUGIN_RECOMMENDS QmlPreview SOURCES designmodecontext.cpp designmodecontext.h designmodewidget.cpp designmodewidget.h diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt index 7ef09420ee2..c1aeb5c54fa 100644 --- a/src/tools/qml2puppet/CMakeLists.txt +++ b/src/tools/qml2puppet/CMakeLists.txt @@ -39,11 +39,13 @@ add_qtc_executable(qml2puppet qmlpuppet.qrc ) -if (NOT "$ENV{QDS_PUPPET_VERSION}" STREQUAL "") - set_target_properties(qml2puppet PROPERTIES OUTPUT_NAME qml2puppet-$ENV{QDS_PUPPET_VERSION}) -else() - set_target_properties(qml2puppet PROPERTIES OUTPUT_NAME qml2puppet-${IDE_VERSION}) +set(qml2puppet_suffix $ENV{QDS_PUPPET_VERSION}) +if (NOT qml2puppet_suffix) + set(qml2puppet_suffix ${IDE_VERSION}) endif() +extend_qtc_executable(qml2puppet + PROPERTIES OUTPUT_NAME qml2puppet-${qml2puppet_suffix} +) extend_qtc_executable(qml2puppet CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.0.0