From 0416941fd150b7163795ccdf1b514aa2d64221c8 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Tue, 20 Feb 2024 18:56:42 +0100 Subject: [PATCH] CMake: introduce option BUILD_DESIGNSTUDIO This change needs an update of the super repository If you want to buid QtDesignStudio documentation no branding path is necessary anymore: cmake -DCMAKE_GENERATOR:STRING=Ninja -DWITH_DOCS=ON -DCMAKE_PREFIX_PATH:PATH=C:\Qt_online\6.5.3\msvc2019_64 -DBUILD_DESIGNSTUDIO=ON C:/dev/tqtc-qtc-super/qtcreator cmake --build . --target html_docs Task-number: QDS-9827 Task-number: QTCREATORBUG-24222 Change-Id: Ic779b6ab57c71c7f6fa53467bf1ba3ee17cab0ea Reviewed-by: Tim Jenssen --- CMakeLists.txt | 5 +++ dist/branding/qtdesignstudio/CMakeLists.txt | 1 - .../qtdesignstudio/QtCreatorIDEBranding.cmake | 45 +++++++++++++++++++ .../QtProject/QtDesignStudio.ini | 1 + .../src/qtcreator-documentation.qdoc | 9 ++-- doc/qtdesignstudio/README.md | 20 +-------- .../qtcreator/qmldesigner}/EasingCurves.ini | 0 src/plugins/qmldesigner/CMakeLists.txt | 13 ++++++ .../timelineeditor/preseteditor.cpp | 2 +- 9 files changed, 70 insertions(+), 26 deletions(-) delete mode 100644 dist/branding/qtdesignstudio/CMakeLists.txt rename {dist/branding/qtdesignstudio/QtProject/qtdesignstudio => share/qtcreator/qmldesigner}/EasingCurves.ini (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2aefb1a58dd..63ca493c29a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ cmake_minimum_required(VERSION 3.16) +option(BUILD_DESIGNSTUDIO "Build and install design studio plugins, examples and settings." OFF) +if (BUILD_DESIGNSTUDIO) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/dist/branding/qtdesignstudio") +endif() + ## Add paths to check for cmake modules: list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(Utils) diff --git a/dist/branding/qtdesignstudio/CMakeLists.txt b/dist/branding/qtdesignstudio/CMakeLists.txt deleted file mode 100644 index 7886ac3ef6d..00000000000 --- a/dist/branding/qtdesignstudio/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -install(DIRECTORY QtProject DESTINATION "${IDE_DATA_PATH}") diff --git a/dist/branding/qtdesignstudio/QtCreatorIDEBranding.cmake b/dist/branding/qtdesignstudio/QtCreatorIDEBranding.cmake index e2131bcc757..204cedffdb1 100644 --- a/dist/branding/qtdesignstudio/QtCreatorIDEBranding.cmake +++ b/dist/branding/qtdesignstudio/QtCreatorIDEBranding.cmake @@ -16,3 +16,48 @@ set(IDE_DOC_FILE_ONLINE "qtdesignstudio/qtdesignstudio-online.qdocconf") set(IDE_ICON_PATH "${CMAKE_CURRENT_LIST_DIR}") set(IDE_LOGO_PATH "${CMAKE_CURRENT_LIST_DIR}") + +set(DESIGNSTUDIO_PLUGINS + Android + BareMetal + Boot2Qt + CMakeProjectManager + CodePaster + Core + CppEditor + Debugger + Designer + DiffEditor + EffectComposer + Help + Insight + LanguageClient + McuSupport + ProjectExplorer + QmakeProjectManager + QmlDesigner + QmlDesignerBase + QmlJSEditor + QmlJSTools + QmlPreview + QmlProjectManager + QtSupport + RemoteLinux + ResourceEditor + StudioPlugin + StudioWelcome + Texteditor + UpdateInfo + VcsBase + assetexporterplugin + componentsplugin + qmlpreviewplugin + qtquickplugin) + +if(DESIGNSTUDIO_EXTRAPLUGINS) + list(APPEND DESIGNSTUDIO_PLUGINS ${DESIGNSTUDIO_EXTRAPLUGINS}) +endif() + +if(NOT BUILD_PLUGINS) + set(BUILD_PLUGINS "${DESIGNSTUDIO_PLUGINS}" CACHE STRING "Build plugins" FORCE) +endif() diff --git a/dist/branding/qtdesignstudio/QtProject/QtDesignStudio.ini b/dist/branding/qtdesignstudio/QtProject/QtDesignStudio.ini index 4685e29f3bd..a48e5ded50a 100644 --- a/dist/branding/qtdesignstudio/QtProject/QtDesignStudio.ini +++ b/dist/branding/qtdesignstudio/QtProject/QtDesignStudio.ini @@ -52,6 +52,7 @@ flashActionDisabled=true OverrideLanguage=C [General] HideOptionCategories=C++, Debug, Designer, Kits, BuildAndRun, CPaster, LanguageClient, Version Control +SuppressedWarnings=LinkWithQtInstallation [Help] ContextHelpOption=3 diff --git a/doc/qtcreatordev/src/qtcreator-documentation.qdoc b/doc/qtcreatordev/src/qtcreator-documentation.qdoc index 9e567c6fd4f..ffed1871a57 100644 --- a/doc/qtcreatordev/src/qtcreator-documentation.qdoc +++ b/doc/qtcreatordev/src/qtcreator-documentation.qdoc @@ -387,8 +387,7 @@ separate doc build folder, not in the project folder. To get the correct product name and version when building \QDS Manual, you - must run CMake with the branding option. The branding data is located in - the \QDS (private) repository, \c tqtc-plugin-qtquickdesigner. + must run CMake with the BUILD_DESIGNSTUDIO option. To build docs with CMake in a separate doc build folder: @@ -408,12 +407,12 @@ \li To also build Extending \QC Manual, add the following option: \c {-DBUILD_DEVELOPER_DOCS=ON} \li To also build the \QDS Manual, add the following option: - \c {"-DCMAKE_MODULE_PATH=/studiodata/branding/"} + \c {-DBUILD_DESIGNSTUDIO=ON} For example: \badcode C:\dev\qtc-doc-build>cmake -DWITH_DOCS=ON -DBUILD_DEVELOPER_DOCS=ON - "-DCMAKE_MODULE_PATH=C:\dev\tqtc-plugin-qtquickdesigner\studiodata\branding" + -DBUILD_DESIGNSTUDIO=ON "-DCMAKE_PREFIX_PATH=C:\Qt\6.4.0\msvc2019_64" C:\dev\qtc-super\qtcreator \endcode @@ -425,7 +424,7 @@ \badcode C:\dev\qtc-doc-build>cmake -DWITH_ONLINE_DOCS=ON -DBUILD_DEVELOPER_DOCS=ON - "-DCMAKE_MODULE_PATH=C:\dev\tqtc-plugin-qtquickdesigner\studiodata\branding" + -DBUILD_DESIGNSTUDIO=ON "-DCMAKE_PREFIX_PATH=C:\Qt\6.4.0\msvc2019_64" C:\dev\qtc-super\qtcreator \endcode diff --git a/doc/qtdesignstudio/README.md b/doc/qtdesignstudio/README.md index c23a21a9a2f..bbb46d13bb8 100644 --- a/doc/qtdesignstudio/README.md +++ b/doc/qtdesignstudio/README.md @@ -7,22 +7,4 @@ separate table of contents files for each Manual and by using defines to hide and show information depending on which Manual is being built. Because branding information is needed to use the correct product name and -version, you must run `qmake -r` on `qtcreator.pro` with the `IDE_BRANDING_PRI` -option set to the absolute path of `ide_branding.pri` in the Qt Design Studio -repository. - -For example, on Windows enter (all on one line): - -`C:\dev\qtc-super\qtcreator>..\..\..\Qt\5.14.1\msvc2017_64\bin\qmake.exe - qtcreator.pro -r - IDE_BRANDING_PRI=C:\dev\tqtc-plugin-qtquickdesigner\studiodata\branding\ide_branding.pri` - -## Building the Qt Design Studio Manual - -1. Run `qmake` from Qt 5.14.0, or later with the path to the branding - information as a parameter: - `\qmake.exe qtcreator.pro -r IDE_BRANDING_PRI=\tqtc-plugin-qtquickdesigner\studiodata\branding\ide_branding.pri` -5. Run `make docs` on Linux and macOS or `nmake docs` on Windows. - -The docs are generated in `qtcreator\doc\html\qtdesignstudio` with the -Qt Design Studio branding. +version. diff --git a/dist/branding/qtdesignstudio/QtProject/qtdesignstudio/EasingCurves.ini b/share/qtcreator/qmldesigner/EasingCurves.ini similarity index 100% rename from dist/branding/qtdesignstudio/QtProject/qtdesignstudio/EasingCurves.ini rename to share/qtcreator/qmldesigner/EasingCurves.ini diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 0ca1db57516..f520495d7c1 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -1243,3 +1243,16 @@ extend_qtc_plugin(qtquickplugin qtquickplugin.cpp qtquickplugin.h qtquickplugin.qrc ) + +if (BUILD_DESIGNSTUDIO) + configure_file( + "${QtCreator_SOURCE_DIR}/dist/branding/qtdesignstudio/QtProject/QtDesignStudio.ini" + "${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}/QtProject/${IDE_CASED_ID}.ini" + COPYONLY + ) + install(FILES + ${QtCreator_SOURCE_DIR}/dist/branding/qtdesignstudio/QtProject/QtDesignStudio.ini + DESTINATION ${IDE_DATA_PATH}/QtProject + RENAME ${IDE_CASED_ID}.ini + ) +endif () diff --git a/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp b/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp index 0f12c6ce2de..b06023242f1 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp @@ -137,7 +137,7 @@ const char settingsFileName[] = "EasingCurves.ini"; QString settingsFullFilePath(const QSettings::Scope &scope) { if (scope == QSettings::SystemScope) - return Core::ICore::installerResourcePath(settingsFileName).toString(); + return Core::ICore::resourcePath("qmldesigner/%1").toString().arg(settingsFileName); return Core::ICore::userResourcePath(settingsFileName).toString(); }