From a4b1cb172e05503dcc0957d006c51a009620fcf9 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Tue, 11 Nov 2025 19:14:16 +0100 Subject: [PATCH 01/21] Qt6 build and liblcf update Co-Authored-By: maple! --- .gitignore | 2 ++ CMakeLists.txt | 26 +++++++++++++------------- README.adoc | 4 ++-- docs/AUTHORS.adoc | 1 + src/common/dbstring.h | 2 +- src/common/lcf_widget_binding.h | 10 +++++----- src/model/event_command_list.cpp | 1 + src/model/project.cpp | 8 ++++---- src/stringizer.cpp | 4 ++-- src/ui/other/musicplayer.cpp | 22 +++++++++++----------- src/ui/other/musicplayer.h | 2 +- src/ui/other/volumebutton.cpp | 2 +- src/ui/picker/picker_dialog.cpp | 4 ++-- 13 files changed, 46 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 4779056d..30587992 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,8 @@ cmake-build-*/ # Visual Studio Code .vscode/ +.cache/ +build/ # Mac .DS_Store diff --git a/CMakeLists.txt b/CMakeLists.txt index f3e43d30..9fe35c9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -378,8 +378,8 @@ set_target_properties(${EXE_NAME} PROPERTIES set(CMAKE_INCLUDE_CURRENT_DIR ON) # Dependencies -find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg) -find_package(Qt5LinguistTools CONFIG QUIET) +find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg) +find_package(Qt6LinguistTools CONFIG QUIET) find_package(ZLIB REQUIRED) # liblcf option(EDITOR_BUILD_LIBLCF "Instead of detecting liblcf the liblcf repository is cloned into lib/liblcf and built together with the Player. This is convenient for development" OFF) @@ -414,20 +414,20 @@ endif() # Libraries target_link_libraries(${EXE_NAME} - ZLIB::ZLIB - Qt5::Widgets - Qt5::Gui - Qt5::Core - Qt5::Multimedia - Qt5::Svg - Qt5::QSvgIconPlugin + ZLIB::ZLIB + Qt6::Widgets + Qt6::Gui + Qt6::Core + Qt6::Multimedia + Qt6::Svg + Qt6::QSvgIconPlugin ) # Add resources target_sources(${EXE_NAME} PRIVATE "resources/Resources.qrc") # Translations -if(TARGET Qt5::lrelease) +if(TARGET Qt6::lrelease) set(TRANSLATION_SOURCES translations/editor_de.ts ) @@ -435,11 +435,11 @@ if(TARGET Qt5::lrelease) configure_file(translations/editor.qrc ${TRANSLATION_RES} COPYONLY) set_source_files_properties(${TRANSLATION_SOURCES} PROPERTIES OUTPUT_LOCATION "translations") - qt5_add_translation(EDITOR_TRANSLATIONS ${TRANSLATION_SOURCES} + qt_add_translation(EDITOR_TRANSLATIONS ${TRANSLATION_SOURCES} OPTIONS -compress -nounfinished -removeidentical) target_sources(${EXE_NAME} PRIVATE ${TRANSLATION_RES} ${EDITOR_TRANSLATIONS}) add_custom_target(translations - COMMAND ${Qt5_LUPDATE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src -ts ${TRANSLATION_SOURCES} + COMMAND ${Qt6_LUPDATE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src -ts ${TRANSLATION_SOURCES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Create/Update translations..." COMMAND_EXPAND_LISTS VERBATIM) @@ -451,7 +451,7 @@ endif() include(GNUInstallDirs) if(APPLE) # Find Qt deployment apps - get_target_property(_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) + get_target_property(_QMAKE_EXECUTABLE Qt6::qmake IMPORTED_LOCATION) get_filename_component(_QT_BIN_DIR "${_QMAKE_EXECUTABLE}" DIRECTORY) find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_QT_BIN_DIR}") diff --git a/README.adoc b/README.adoc index c9ce60d1..e4710793 100644 --- a/README.adoc +++ b/README.adoc @@ -2,7 +2,7 @@ // hide ugly links behind atributes to not interrupt plain text flow :docs: link:docs[docs folder] :liblcf: https://github.com/EasyRPG/liblcf[liblcf] -:qt5: https://www.qt.io[Qt 5] +:qt6: https://www.qt.io[Qt 6] :translation: link:docs/Translation.adoc[Translation] :irc-channel: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat/#easyrpg?nick=rpgguest?? :authors-doc: link:docs/AUTHORS.adoc[AUTHORS document] @@ -25,7 +25,7 @@ https://wiki.easyrpg.org == Requirements - {liblcf} for RPG Maker data reading. -- {qt5} (>= 5.11) +- {qt6} (>= 6.10) - Qt Multimedia - Qt SVG - Qt Linguist (optional, for translation) diff --git a/docs/AUTHORS.adoc b/docs/AUTHORS.adoc index 9df98cb4..339aa689 100644 --- a/docs/AUTHORS.adoc +++ b/docs/AUTHORS.adoc @@ -4,6 +4,7 @@ * Diego Pedraza (zegeri) * Francisco de la Peña (fdelapena) * Gabriel Kind (Ghabry) +* lumiscosity * Marcel Hellwig (hellow554) * Mariano Javier Suligoy (MarianoGNU) * Matthew Fioravante (fmatthew5876) diff --git a/src/common/dbstring.h b/src/common/dbstring.h index f579637e..75c22d8a 100644 --- a/src/common/dbstring.h +++ b/src/common/dbstring.h @@ -25,7 +25,7 @@ inline QString ToQString(const std::string& s) { return QString::fromStdString(s); } -inline QString ToQString(lcf::StringView s) { +inline QString ToQString(std::string_view s) { return QString::fromUtf8(s.data(), s.size()); } diff --git a/src/common/lcf_widget_binding.h b/src/common/lcf_widget_binding.h index 3ea210b8..0921e805 100644 --- a/src/common/lcf_widget_binding.h +++ b/src/common/lcf_widget_binding.h @@ -29,22 +29,22 @@ class QGroupBox; #include #include #include +#include #include #include "ui/common/rpg_combobox.h" #include "signal_blocker.h" template -class LcfObjectHolder : QObject { +class LcfObjectHolder { + public: LcfObjectHolder() = default; + ~LcfObjectHolder() = default; + LcfObjectHolder(const LcfObjectHolder &) = default; LcfObjectHolder(T& obj) : m_obj(&obj) {} - LcfObjectHolder(const LcfObjectHolder& other) : QObject(nullptr) { - m_obj = other.m_obj; - } - T& obj() { return *m_obj; } diff --git a/src/model/event_command_list.cpp b/src/model/event_command_list.cpp index 74256b2e..8c8019e1 100644 --- a/src/model/event_command_list.cpp +++ b/src/model/event_command_list.cpp @@ -16,6 +16,7 @@ */ #include "event_command_list.h" +#include EventCommandList::EventCommandList(std::vector& commands, int current_index) : m_commands(&commands), m_current_index(current_index) diff --git a/src/model/project.cpp b/src/model/project.cpp index af4c89e1..8a11d828 100644 --- a/src/model/project.cpp +++ b/src/model/project.cpp @@ -69,11 +69,11 @@ std::shared_ptr Project::load(const QDir& dir) { if (!cfg.isNull()) { lcf::INIReader ini(cfg.toStdString()); - std::string title = ini.GetString("RPG_RT", GAMETITLE, tr("Untitled").toStdString()); + auto title = ini.GetString("RPG_RT", GAMETITLE, tr("Untitled").toStdString()); if (project_type == FileFinder::ProjectType::Legacy) { // Check for game encoding - std::string enc = ini.GetString("EasyRPG", "Encoding", ""); + auto enc = ini.GetString("EasyRPG", "Encoding", ""); if (enc.empty()) { // Only use the title for encoding detection // This is called for all games in the "Open Project" list @@ -81,11 +81,11 @@ std::shared_ptr Project::load(const QDir& dir) { enc = lcf::ReaderUtil::DetectEncoding(title); } - p->setEncoding(QString::fromStdString(enc)); + p->setEncoding(QString::fromStdString(std::string(enc))); title = lcf::ReaderUtil::Recode(title, enc); } - p->setGameTitle(QString::fromStdString(title)); + p->setGameTitle(QString::fromStdString(std::string(title))); } return p; diff --git a/src/stringizer.cpp b/src/stringizer.cpp index 60549654..544ee2fc 100644 --- a/src/stringizer.cpp +++ b/src/stringizer.cpp @@ -1092,9 +1092,9 @@ namespace break; case 7: // Vehicle in use condition = Stringizer::tr("Vehicle") + " " - + com.parameters[1] == 0 ? Stringizer::tr("Boat") : + + (com.parameters[1] == 0 ? Stringizer::tr("Boat") : com.parameters[1] == 1 ? Stringizer::tr("Ship") : - com.parameters[1] == 2 ? Stringizer::tr("Airship") : Stringizer::tr("Unknown"); + com.parameters[1] == 2 ? Stringizer::tr("Airship") : Stringizer::tr("Unknown")); break; case 8: // Key decision initiated this event condition = Stringizer::tr("Event Started with Decision Key"); diff --git a/src/ui/other/musicplayer.cpp b/src/ui/other/musicplayer.cpp index 7d56df9d..8cd0c6dc 100644 --- a/src/ui/other/musicplayer.cpp +++ b/src/ui/other/musicplayer.cpp @@ -78,8 +78,8 @@ MusicPlayer::MusicPlayer(QWidget *parent) : QWidget(parent), connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(updateDuration(qint64))); connect(&mediaPlayer, SIGNAL(metaDataAvailableChanged(bool)), this, SLOT(updateInfo())); connect(&mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(handleError())); - connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), - this, SLOT(updateState(QMediaPlayer::State))); + //connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), + // this, SLOT(updateState(QMediaPlayer::State))); } void MusicPlayer::openFile() @@ -97,18 +97,18 @@ void MusicPlayer::playFile(const QString &filePath) playButton->setEnabled(true); infoLabel->setText(QFileInfo(filePath).fileName()); - mediaPlayer.setMedia(QUrl::fromLocalFile(filePath)); + //mediaPlayer.setMedia(QUrl::fromLocalFile(filePath)); mediaPlayer.play(); } void MusicPlayer::togglePlayback() { - if (mediaPlayer.mediaStatus() == QMediaPlayer::NoMedia) + /*if (mediaPlayer.mediaStatus() == QMediaPlayer::NoMedia) openFile(); else if (mediaPlayer.state() == QMediaPlayer::PlayingState) mediaPlayer.pause(); else - mediaPlayer.play(); + mediaPlayer.play();*/ } void MusicPlayer::seekForward() @@ -143,7 +143,7 @@ void MusicPlayer::mouseReleaseEvent(QMouseEvent *event) offset = QPoint(); event->accept(); } - +/* void MusicPlayer::updateState(QMediaPlayer::State state) { if (state == QMediaPlayer::PlayingState) { @@ -154,7 +154,7 @@ void MusicPlayer::updateState(QMediaPlayer::State state) playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); } } - +*/ void MusicPlayer::updatePosition(qint64 position) { positionSlider->setValue(static_cast(position)); @@ -179,7 +179,7 @@ void MusicPlayer::setPosition(int position) void MusicPlayer::updateInfo() { - QStringList info; + /*QStringList info; QString author = mediaPlayer.metaData("Author").toString(); if (!author.isEmpty()) info += author; @@ -187,7 +187,7 @@ void MusicPlayer::updateInfo() if (!title.isEmpty()) info += title; if (!info.isEmpty()) - infoLabel->setText(info.join(tr(" - "))); + infoLabel->setText(info.join(tr(" - ")));*/ } void MusicPlayer::handleError() @@ -212,7 +212,7 @@ void MusicPlayer::createWidgets() volumeButton = new VolumeButton(this); volumeButton->setToolTip(tr("Adjust volume")); - volumeButton->setVolume(mediaPlayer.volume()); + //volumeButton->setVolume(mediaPlayer.volume()); connect(volumeButton, SIGNAL(volumeChanged(int)), &mediaPlayer, SLOT(setVolume(int))); positionSlider = new QSlider(Qt::Horizontal, this); @@ -225,7 +225,7 @@ void MusicPlayer::createWidgets() positionLabel->setMinimumWidth(positionLabel->sizeHint().width()); QBoxLayout *controlLayout = new QHBoxLayout; - controlLayout->setMargin(0); + //controlLayout->setMargin(0); controlLayout->addWidget(openButton); controlLayout->addWidget(playButton); controlLayout->addWidget(positionSlider); diff --git a/src/ui/other/musicplayer.h b/src/ui/other/musicplayer.h index 92fc7e1b..0ae8a8f2 100644 --- a/src/ui/other/musicplayer.h +++ b/src/ui/other/musicplayer.h @@ -86,7 +86,7 @@ public slots: void mouseReleaseEvent(QMouseEvent *event); private slots: - void updateState(QMediaPlayer::State state); + //void updateState(QMediaPlayer::State state); void updatePosition(qint64 position); void updateDuration(qint64 duration); void setPosition(int position); diff --git a/src/ui/other/volumebutton.cpp b/src/ui/other/volumebutton.cpp index a7abd1e2..9a30f23c 100644 --- a/src/ui/other/volumebutton.cpp +++ b/src/ui/other/volumebutton.cpp @@ -78,7 +78,7 @@ VolumeButton::VolumeButton(QWidget *parent) : connect(slider, SIGNAL(valueChanged(int)), label, SLOT(setNum(int))); QBoxLayout *popupLayout = new QHBoxLayout(popup); - popupLayout->setMargin(2); + //popupLayout->setMargin(2); popupLayout->addWidget(slider); popupLayout->addWidget(label); diff --git a/src/ui/picker/picker_dialog.cpp b/src/ui/picker/picker_dialog.cpp index 54490f28..b0eaff04 100644 --- a/src/ui/picker/picker_dialog.cpp +++ b/src/ui/picker/picker_dialog.cpp @@ -83,7 +83,7 @@ void PickerDialog::buttonClicked(QAbstractButton* button) { } void PickerDialog::setDirectoryAndFile(const QString &dir, const QString& initialFile) { - m_dir = QDir(dir); + m_dir.setPath(dir); QString path = m_project.project().findDirectory(dir); QString file = m_project.project().findFile(dir, initialFile, m_file_type); m_model->setRootPath(path); @@ -92,7 +92,7 @@ void PickerDialog::setDirectoryAndFile(const QString &dir, const QString& initia QModelIndex index = m_model->index(file); ui->filesystemView->setCurrentIndex(index); - m_currentFile = file; + m_currentFile = QFileInfo(file); ui->wrappedWidget->fileChanged(m_currentFile.absoluteFilePath()); From f2b4af4f2a48deee1e4b2c5d92e2bb7d7aafc5fe Mon Sep 17 00:00:00 2001 From: Ghabry Date: Tue, 11 Nov 2025 19:16:36 +0100 Subject: [PATCH 02/21] Bump C++ Standard to 23 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fe35c9c..d41ccbaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") include(ConfigureWindows) # C++17 is required -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) From 2216bc4c0a2a6810040c8508f631f28f82504cef Mon Sep 17 00:00:00 2001 From: Ghabry Date: Tue, 11 Nov 2025 20:41:41 +0100 Subject: [PATCH 03/21] Add Kirigami --- CMakeLists.txt | 51 +++++++++++++++++++++++++++++++++------------ src/main.cpp | 12 +++++++++-- src/ui/MainPage.qml | 29 ++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 15 deletions(-) create mode 100644 src/ui/MainPage.qml diff --git a/CMakeLists.txt b/CMakeLists.txt index d41ccbaa..a584ab74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,13 @@ cmake_policy(SET CMP0091 NEW) # Support MSVC_RUNTIME_LIBRARY project(EasyRPG_Editor VERSION 0.1.0 LANGUAGES CXX) +# Qt6 and KF6 required +set(REQUIRED_QT_VERSION "6.0.0") +set(KF_DEP_VERSION "6.12.0") + # Extra CMake Module files -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") +find_package(ECM ${KF_DEP_VERSION} REQUIRED) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ${ECM_MODULE_PATH}) include(ConfigureWindows) # C++17 is required @@ -317,6 +322,10 @@ set(EDITOR_SOURCES src/ui/viewer/stat_curve_graphics_item.h ) +set(EDITOR_QML + src/ui/MainPage.qml +) + if(APPLE) # Do not code sign set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") @@ -377,10 +386,25 @@ set_target_properties(${EXE_NAME} PROPERTIES ) set(CMAKE_INCLUDE_CURRENT_DIR ON) -# Dependencies -find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg) +find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg QuickControls2) find_package(Qt6LinguistTools CONFIG QUIET) find_package(ZLIB REQUIRED) +find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS Kirigami ItemModels) + +include(ECMQmlModule) +include(ECMFindQmlModule) + +ecm_add_qml_module(${EXE_NAME} + URI + org.easyrpg.editor +) + +ecm_target_qml_sources(${EXE_NAME} + SOURCES ${EDITOR_QML} +) + +ecm_find_qmlmodule(org.kde.kitemmodels 1.0) + # liblcf option(EDITOR_BUILD_LIBLCF "Instead of detecting liblcf the liblcf repository is cloned into lib/liblcf and built together with the Player. This is convenient for development" OFF) set(EDITOR_BUILD_LIBLCF_GIT "https://github.com/EasyRPG/liblcf.git" CACHE STRING "Git repository of liblcf to clone when building liblcf. Requires EDITOR_BUILD_LIBLCF=ON.") @@ -405,22 +429,23 @@ if(EDITOR_BUILD_LIBLCF) add_subdirectory(${LIBLCF_PATH}) endfunction() add_liblcf() - target_link_libraries(${EXE_NAME} lcf) + target_link_libraries(${EXE_NAME} PRIVATE lcf) else() # Use system package find_package(liblcf REQUIRED) - target_link_libraries(${EXE_NAME} liblcf::liblcf) + target_link_libraries(${EXE_NAME} PRIVATE liblcf::liblcf) endif() # Libraries -target_link_libraries(${EXE_NAME} - ZLIB::ZLIB - Qt6::Widgets - Qt6::Gui - Qt6::Core - Qt6::Multimedia - Qt6::Svg - Qt6::QSvgIconPlugin +target_link_libraries(${EXE_NAME} PRIVATE + ZLIB::ZLIB + Qt6::Widgets + Qt6::Gui + Qt6::Core + Qt6::Multimedia + Qt6::Svg + Qt6::QSvgIconPlugin + Qt6::QuickControls2 ) # Add resources diff --git a/src/main.cpp b/src/main.cpp index 2d9f2dc9..d4bf69b7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,12 +16,12 @@ */ #include "ui/main_window.h" -#include "ui/event/event_page_widget.h" #include #include #include #include #include +#include int main(int argc, char *argv[]) { @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) QPixmap logo(":/app/splash.png"); QSplashScreen s(logo, Qt::WindowStaysOnTopHint); s.showMessage("EasyRPG Editor"); - s.show(); + //s.show(); #ifdef NDEBUG // close splash after 3 seconds for release QTimer::singleShot(3000, &s, &QWidget::close); @@ -41,6 +41,14 @@ int main(int argc, char *argv[]) a.setOrganizationName("EasyRPG"); a.setOrganizationDomain("easyrpg.org"); + qputenv("QML_IMPORT_TRACE", "1"); + QQmlApplicationEngine engine; + engine.loadFromModule("org.easyrpg.editor", "MainPage"); + + if (engine.rootObjects().isEmpty()) { + return -1; + } + // load translations s.showMessage("Loading translations..."); a.processEvents(); diff --git a/src/ui/MainPage.qml b/src/ui/MainPage.qml new file mode 100644 index 00000000..caba429b --- /dev/null +++ b/src/ui/MainPage.qml @@ -0,0 +1,29 @@ +// Includes relevant modules used by the QML +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as Controls +import org.kde.kirigami as Kirigami + +// Provides basic features needed for all kirigami applications +Kirigami.ApplicationWindow { + // Unique identifier to reference this object + id: root + + width: 400 + height: 300 + + // Window title + // i18nc() makes a string translatable + // and provides additional context for the translators + title: "Hello World" + + // Set the first page that will be loaded when the app opens + // This can also be set to an id of a Kirigami.Page + pageStack.initialPage: Kirigami.Page { + Controls.Label { + // Center label horizontally and vertically within parent object + anchors.centerIn: parent + text: "Hello World!" + } + } +} From 29b74f9f147bb4168b98e169b6b1dbbcc0bdd4b8 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 18 Feb 2026 15:01:46 +0100 Subject: [PATCH 04/21] Configuration / Formatting --- .clang-format | 7 +++++++ .editorconfig | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..2b58022a --- /dev/null +++ b/.clang-format @@ -0,0 +1,7 @@ +IndentWidth: 4 +UseTab: Always +TabWidth: 4 +BasedOnStyle: LLVM +IndentAccessModifiers: false +AccessModifierOffset: -4 +PointerAlignment: Left diff --git a/.editorconfig b/.editorconfig index ecb1e74d..96127524 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,6 +23,10 @@ indent_size = 4 indent_style = space indent_size = 2 +[*.qml] +indent_style = space +indent_size = 4 + [*.qrc] indent_style = space indent_size = 4 From cf964d4bfab51bb82c3e5a8bfb58313f8b473127 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 18 Feb 2026 15:11:14 +0100 Subject: [PATCH 05/21] Building Correctly build QML module Add CMake Preset (based on Player presets) Add vcpkg overlays for Kirigami and dependencies. Kirigami is releasing updates quite often so is better to handle this in the editor repository until editor development is more advanced. Add glaze dependency (JSON parser for binding the structs to QML later) --- CMakeLists.txt | 39 +- CMakePresets.json | 517 ++++++++++++++++++ builds/vcpkg_overlay/ecm/portfile.cmake | 30 + builds/vcpkg_overlay/ecm/usage | 9 + builds/vcpkg_overlay/ecm/vcpkg.json | 17 + .../kddockwidgets/portfile.cmake | 52 ++ builds/vcpkg_overlay/kddockwidgets/vcpkg.json | 27 + builds/vcpkg_overlay/kirigami/portfile.cmake | 42 ++ builds/vcpkg_overlay/kirigami/vcpkg.json | 21 + builds/vcpkg_overlay/qtbase/portfile.cmake | 4 + builds/vcpkg_overlay/qtbase/vcpkg.json | 10 + cmake/CMakePresets.json.template | 55 ++ cmake/CMakePresetsBase.json | 81 +++ cmake/CMakePresetsUser.json | 45 ++ cmake/Modules/ConfigureWindows.cmake | 2 +- cmake/gen-cmake-presets.py | 130 +++++ src/qmlbinding/empty.h | 0 src/ui/MainPage.qml | 29 - src/ui/MainWindow.qml | 21 + vcpkg.json | 15 + 20 files changed, 1107 insertions(+), 39 deletions(-) create mode 100644 CMakePresets.json create mode 100644 builds/vcpkg_overlay/ecm/portfile.cmake create mode 100644 builds/vcpkg_overlay/ecm/usage create mode 100644 builds/vcpkg_overlay/ecm/vcpkg.json create mode 100644 builds/vcpkg_overlay/kddockwidgets/portfile.cmake create mode 100644 builds/vcpkg_overlay/kddockwidgets/vcpkg.json create mode 100644 builds/vcpkg_overlay/kirigami/portfile.cmake create mode 100644 builds/vcpkg_overlay/kirigami/vcpkg.json create mode 100644 builds/vcpkg_overlay/qtbase/portfile.cmake create mode 100644 builds/vcpkg_overlay/qtbase/vcpkg.json create mode 100644 cmake/CMakePresets.json.template create mode 100644 cmake/CMakePresetsBase.json create mode 100644 cmake/CMakePresetsUser.json create mode 100644 cmake/gen-cmake-presets.py create mode 100644 src/qmlbinding/empty.h delete mode 100644 src/ui/MainPage.qml create mode 100644 src/ui/MainWindow.qml create mode 100644 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index a584ab74..fbac7ac4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,14 +4,21 @@ cmake_policy(SET CMP0091 NEW) # Support MSVC_RUNTIME_LIBRARY project(EasyRPG_Editor VERSION 0.1.0 LANGUAGES CXX) # Qt6 and KF6 required -set(REQUIRED_QT_VERSION "6.0.0") -set(KF_DEP_VERSION "6.12.0") +set(REQUIRED_QT_VERSION "6.11.0") +set(KF_DEP_VERSION "6.11.0") # Extra CMake Module files find_package(ECM ${KF_DEP_VERSION} REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ${ECM_MODULE_PATH}) include(ConfigureWindows) +# Dependencies provided by CMake Presets +option(EDITOR_FIND_ROOT_PATH_APPEND "When enabled the items from CMAKE_PREFIX_PATH are added to CMAKE_FIND_ROOT_PATH. Works around problematic CMake Toolchain files" OFF) +list(APPEND CMAKE_PREFIX_PATH "${EDITOR_PREFIX_PATH_APPEND}") +if(EDITOR_FIND_ROOT_PATH_APPEND) + list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_PREFIX_PATH}") +endif() + # C++17 is required set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -322,8 +329,12 @@ set(EDITOR_SOURCES src/ui/viewer/stat_curve_graphics_item.h ) -set(EDITOR_QML - src/ui/MainPage.qml +set(EDITOR_QML_UI + src/ui/MainWindow.qml +) + +set(EDITOR_QML_INTERFACE + src/qmlbinding/empty.h ) if(APPLE) @@ -356,12 +367,18 @@ else() else() set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "easyrpg-editor") endif() + + # QML Debugger support + if(CMAKE_BUILD_TYPE MATCHES "Debug") + target_compile_definitions(${EXE_NAME} PRIVATE QT_QML_DEBUG=1) + endif() endif() # Include directories target_include_directories(${EXE_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/src/qmlbinding # Required by QML build step INTERFACE $ ) @@ -389,18 +406,22 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg QuickControls2) find_package(Qt6LinguistTools CONFIG QUIET) find_package(ZLIB REQUIRED) -find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS Kirigami ItemModels) +find_package(glaze REQUIRED) +find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS Kirigami) include(ECMQmlModule) include(ECMFindQmlModule) ecm_add_qml_module(${EXE_NAME} - URI - org.easyrpg.editor + URI "org.easyrpg.editor" + VERSION 1.0 + GENERATE_PLUGIN_SOURCE + SOURCES + ${EDITOR_QML_INTERFACE} ) ecm_target_qml_sources(${EXE_NAME} - SOURCES ${EDITOR_QML} + SOURCES ${EDITOR_QML_UI} ) ecm_find_qmlmodule(org.kde.kitemmodels 1.0) @@ -439,12 +460,12 @@ endif() # Libraries target_link_libraries(${EXE_NAME} PRIVATE ZLIB::ZLIB + glaze::glaze Qt6::Widgets Qt6::Gui Qt6::Core Qt6::Multimedia Qt6::Svg - Qt6::QSvgIconPlugin Qt6::QuickControls2 ) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 00000000..3df0993a --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,517 @@ +{ + "vendor": { + "README": { + "line1": "!!! GENERATED FILE. DO NOT EDIT !!!", + "line2": "Modify builds/cmake/CMakePresets.json.template instead", + "line3": "and run gen-cmake-presets.py to regenerate this file." + } + }, + "version": 4, + "cmakeMinimumRequired": { + "major": 3, + "minor": 23, + "patch": 0 + }, + "include": [ + "cmake/CMakePresetsUser.json" + ], + "configurePresets": [ + { + "name": "parent", + "hidden": true, + "inherits": "base-user" + }, + { + "name": "debug", + "displayName": "System environment (Debug)", + "inherits": [ + "parent", + "type-debug" + ] + }, + { + "name": "relwithdebinfo", + "displayName": "System environment (RelWithDebInfo)", + "inherits": [ + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "release", + "displayName": "System environment (Release)", + "inherits": [ + "parent", + "type-release" + ] + }, + { + "name": "liblcf-debug", + "displayName": "System environment (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "parent", + "type-debug" + ] + }, + { + "name": "liblcf-relwithdebinfo", + "displayName": "System environment (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "liblcf-release", + "displayName": "System environment (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "parent", + "type-release" + ] + }, + { + "name": "vcpkg-debug", + "displayName": "System environment (install deps with vcpkg, Debug)", + "inherits": [ + "build-vcpkg", + "parent", + "type-debug" + ] + }, + { + "name": "vcpkg-relwithdebinfo", + "displayName": "System environment (install deps with vcpkg, RelWithDebInfo)", + "inherits": [ + "build-vcpkg", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "vcpkg-release", + "displayName": "System environment (install deps with vcpkg, Release)", + "inherits": [ + "build-vcpkg", + "parent", + "type-release" + ] + }, + { + "name": "vcpkg-liblcf-debug", + "displayName": "System environment (install deps with vcpkg + build liblcf, Debug)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-debug" + ] + }, + { + "name": "vcpkg-liblcf-relwithdebinfo", + "displayName": "System environment (install deps with vcpkg + build liblcf, RelWithDebInfo)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "vcpkg-liblcf-release", + "displayName": "System environment (install deps with vcpkg + build liblcf, Release)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-release" + ] + }, + { + "name": "windows-parent", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-md" + }, + "inherits": "win-user", + "hidden": true + }, + { + "name": "windows-debug", + "displayName": "Windows (Debug)", + "inherits": [ + "windows-parent", + "type-debug" + ] + }, + { + "name": "windows-relwithdebinfo", + "displayName": "Windows (RelWithDebInfo)", + "inherits": [ + "windows-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "windows-release", + "displayName": "Windows (Release)", + "inherits": [ + "windows-parent", + "type-release" + ] + }, + { + "name": "windows-liblcf-debug", + "displayName": "Windows (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-debug" + ] + }, + { + "name": "windows-liblcf-relwithdebinfo", + "displayName": "Windows (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "windows-liblcf-release", + "displayName": "Windows (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-release" + ] + }, + { + "name": "windows-x64-vs2022-parent", + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows-static-md" + }, + "inherits": "win-user", + "hidden": true + }, + { + "name": "windows-x64-vs2022-debug", + "displayName": "Windows (x64) using Visual Studio 2022 (Debug)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-debug" + ] + }, + { + "name": "windows-x64-vs2022-relwithdebinfo", + "displayName": "Windows (x64) using Visual Studio 2022 (RelWithDebInfo)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "windows-x64-vs2022-release", + "displayName": "Windows (x64) using Visual Studio 2022 (Release)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-release" + ] + }, + { + "name": "windows-x64-vs2022-liblcf-debug", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-debug" + ] + }, + { + "name": "windows-x64-vs2022-liblcf-relwithdebinfo", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "windows-x64-vs2022-liblcf-release", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-release" + ] + }, + { + "name": "macos-parent", + "cacheVariables": { + "PLAYER_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/universal", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.9", + "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "hidden": true, + "inherits": "base-user" + }, + { + "name": "macos-debug", + "displayName": "macOS (Debug)", + "inherits": [ + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-relwithdebinfo", + "displayName": "macOS (RelWithDebInfo)", + "inherits": [ + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-release", + "displayName": "macOS (Release)", + "inherits": [ + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-liblcf-debug", + "displayName": "macOS (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-liblcf-relwithdebinfo", + "displayName": "macOS (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-liblcf-release", + "displayName": "macOS (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-vcpkg-debug", + "displayName": "macOS (install deps with vcpkg, Debug)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-vcpkg-relwithdebinfo", + "displayName": "macOS (install deps with vcpkg, RelWithDebInfo)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-vcpkg-release", + "displayName": "macOS (install deps with vcpkg, Release)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-vcpkg-liblcf-debug", + "displayName": "macOS (install deps with vcpkg + build liblcf, Debug)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-vcpkg-liblcf-relwithdebinfo", + "displayName": "macOS (install deps with vcpkg + build liblcf, RelWithDebInfo)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-vcpkg-liblcf-release", + "displayName": "macOS (install deps with vcpkg + build liblcf, Release)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-release" + ] + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "debug" + }, + { + "name": "relwithdebinfo", + "configurePreset": "relwithdebinfo" + }, + { + "name": "release", + "configurePreset": "release" + }, + { + "name": "liblcf-debug", + "configurePreset": "liblcf-debug" + }, + { + "name": "liblcf-relwithdebinfo", + "configurePreset": "liblcf-relwithdebinfo" + }, + { + "name": "liblcf-release", + "configurePreset": "liblcf-release" + }, + { + "name": "vcpkg-debug", + "configurePreset": "vcpkg-debug" + }, + { + "name": "vcpkg-relwithdebinfo", + "configurePreset": "vcpkg-relwithdebinfo" + }, + { + "name": "vcpkg-release", + "configurePreset": "vcpkg-release" + }, + { + "name": "vcpkg-liblcf-debug", + "configurePreset": "vcpkg-liblcf-debug" + }, + { + "name": "vcpkg-liblcf-relwithdebinfo", + "configurePreset": "vcpkg-liblcf-relwithdebinfo" + }, + { + "name": "vcpkg-liblcf-release", + "configurePreset": "vcpkg-liblcf-release" + }, + { + "name": "windows-debug", + "configurePreset": "windows-debug" + }, + { + "name": "windows-relwithdebinfo", + "configurePreset": "windows-relwithdebinfo" + }, + { + "name": "windows-release", + "configurePreset": "windows-release" + }, + { + "name": "windows-liblcf-debug", + "configurePreset": "windows-liblcf-debug" + }, + { + "name": "windows-liblcf-relwithdebinfo", + "configurePreset": "windows-liblcf-relwithdebinfo" + }, + { + "name": "windows-liblcf-release", + "configurePreset": "windows-liblcf-release" + }, + { + "name": "windows-x64-vs2022-debug", + "configurePreset": "windows-x64-vs2022-debug" + }, + { + "name": "windows-x64-vs2022-relwithdebinfo", + "configurePreset": "windows-x64-vs2022-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-release", + "configurePreset": "windows-x64-vs2022-release" + }, + { + "name": "windows-x64-vs2022-liblcf-debug", + "configurePreset": "windows-x64-vs2022-liblcf-debug" + }, + { + "name": "windows-x64-vs2022-liblcf-relwithdebinfo", + "configurePreset": "windows-x64-vs2022-liblcf-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-liblcf-release", + "configurePreset": "windows-x64-vs2022-liblcf-release" + }, + { + "name": "macos-debug", + "configurePreset": "macos-debug" + }, + { + "name": "macos-relwithdebinfo", + "configurePreset": "macos-relwithdebinfo" + }, + { + "name": "macos-release", + "configurePreset": "macos-release" + }, + { + "name": "macos-liblcf-debug", + "configurePreset": "macos-liblcf-debug" + }, + { + "name": "macos-liblcf-relwithdebinfo", + "configurePreset": "macos-liblcf-relwithdebinfo" + }, + { + "name": "macos-liblcf-release", + "configurePreset": "macos-liblcf-release" + }, + { + "name": "macos-vcpkg-debug", + "configurePreset": "macos-vcpkg-debug" + }, + { + "name": "macos-vcpkg-relwithdebinfo", + "configurePreset": "macos-vcpkg-relwithdebinfo" + }, + { + "name": "macos-vcpkg-release", + "configurePreset": "macos-vcpkg-release" + }, + { + "name": "macos-vcpkg-liblcf-debug", + "configurePreset": "macos-vcpkg-liblcf-debug" + }, + { + "name": "macos-vcpkg-liblcf-relwithdebinfo", + "configurePreset": "macos-vcpkg-liblcf-relwithdebinfo" + }, + { + "name": "macos-vcpkg-liblcf-release", + "configurePreset": "macos-vcpkg-liblcf-release" + } + ], + "testPresets": [] +} diff --git a/builds/vcpkg_overlay/ecm/portfile.cmake b/builds/vcpkg_overlay/ecm/portfile.cmake new file mode 100644 index 00000000..7f7f14cd --- /dev/null +++ b/builds/vcpkg_overlay/ecm/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/extra-cmake-modules + REF "v${VERSION}" + SHA512 fe00d410764a335385c960b0f4c55ef8650e70d9a843ea291aa67653d002d6234198d0e71f0cec390a335134272fbc75434b1c997c1b34abf3f800107767b4d7 + HEAD_REF master +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH share/ECM/cmake) + +# Remove debug files +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") + +file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +# Handle copyright +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING-CMAKE-SCRIPTS") + +# Allow empty include directory +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/builds/vcpkg_overlay/ecm/usage b/builds/vcpkg_overlay/ecm/usage new file mode 100644 index 00000000..42821829 --- /dev/null +++ b/builds/vcpkg_overlay/ecm/usage @@ -0,0 +1,9 @@ +ecm provides CMake files: + + find_package(ECM CONFIG REQUIRED NO_MODULE) + list(INSERT CMAKE_MODULE_PATH 0 ${ECM_MODULE_PATH}) + include(KDEInstallDirs) + include(KDECompilerSettings) + include(KDECMakeSettings) + +For more infomation, see https://api.kde.org/ecm/ diff --git a/builds/vcpkg_overlay/ecm/vcpkg.json b/builds/vcpkg_overlay/ecm/vcpkg.json new file mode 100644 index 00000000..40d89c40 --- /dev/null +++ b/builds/vcpkg_overlay/ecm/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "ecm", + "version": "6.20.0", + "port-version": 1, + "description": "Extra CMake Modules (ECM), extra modules and scripts for CMake", + "homepage": "https://github.com/KDE/extra-cmake-modules", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/builds/vcpkg_overlay/kddockwidgets/portfile.cmake b/builds/vcpkg_overlay/kddockwidgets/portfile.cmake new file mode 100644 index 00000000..9a927453 --- /dev/null +++ b/builds/vcpkg_overlay/kddockwidgets/portfile.cmake @@ -0,0 +1,52 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDAB/KDDockWidgets + REF "v${VERSION}" + SHA512 1e220c5cf608c5bb9242b530eb1e45a15dae462b126c12d253483a1213e72374baa75943d8734c5dc79e34b03b480d1a87cd59cb945996abc0ab20b5d649a5cb + HEAD_REF master +) +file(REMOVE_RECURSE + "${SOURCE_PATH}/src/3rdparty" +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" KD_STATIC) + +if(VCPKG_CROSSCOMPILING) + list(APPEND _qarg_OPTIONS + "-DQT_HOST_PATH=${CURRENT_HOST_INSTALLED_DIR}" + "-DQT_HOST_PATH_CMAKE_DIR:PATH=${CURRENT_HOST_INSTALLED_DIR}/share" + ) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${_qarg_OPTIONS} + -DKDDockWidgets_QT6=ON + -DKDDockWidgets_FRONTENDS=qtquick + -DKDDockWidgets_STATIC=${KD_STATIC} + -DKDDockWidgets_PYTHON_BINDINGS=OFF + -DKDDockWidgets_TESTS=OFF + -DKDDockWidgets_EXAMPLES=OFF + # https://github.com/KDAB/KDDockWidgets/blob/v2.1.0/CMakeLists.txt#L301 + -DCMAKE_DISABLE_FIND_PACKAGE_spdlog=ON + -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON + -DCMAKE_REQUIRE_FIND_PACKAGE_nlohmann_json=ON + -DCMAKE_PREFIX_PATH="$ENV{Qt6_Path}" +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/KDDockWidgets-qt6" PACKAGE_NAME kddockwidgets-qt6) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_install_copyright(FILE_LIST + "${SOURCE_PATH}/LICENSE.txt" + "${SOURCE_PATH}/LICENSES/GPL-2.0-only.txt" + "${SOURCE_PATH}/LICENSES/GPL-3.0-only.txt" +) diff --git a/builds/vcpkg_overlay/kddockwidgets/vcpkg.json b/builds/vcpkg_overlay/kddockwidgets/vcpkg.json new file mode 100644 index 00000000..2aa56671 --- /dev/null +++ b/builds/vcpkg_overlay/kddockwidgets/vcpkg.json @@ -0,0 +1,27 @@ +{ + "name": "kddockwidgets", + "version": "2.4.0", + "port-version": 1, + "description": "KDAB's Dock Widget Framework for Qt", + "homepage": "https://www.kdab.com/development-resources/qt-tools/kddockwidgets/", + "license": "GPL-2.0-only OR GPL-3.0-only", + "dependencies": [ + "kdbindings", + "nlohmann-json", + { + "name": "qtbase", + "default-features": false, + "features": [ + "widgets" + ] + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/builds/vcpkg_overlay/kirigami/portfile.cmake b/builds/vcpkg_overlay/kirigami/portfile.cmake new file mode 100644 index 00000000..d44b3fbc --- /dev/null +++ b/builds/vcpkg_overlay/kirigami/portfile.cmake @@ -0,0 +1,42 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kirigami + REF "v${VERSION}" + SHA512 89bd4131bb92804c45f1db095df27e79121aebd5054efea60605f590b64f9e6b718037f800d5133ac78f2dfb6fbd22e694e5fa266f61ef57b375154b5b098cda + HEAD_REF master +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_EXAMPLES=OFF + -DCMAKE_PREFIX_PATH="$ENV{Qt6_Path}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME KF6Kirigami CONFIG_PATH lib/cmake/KF6Kirigami DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(PACKAGE_NAME KF6Kirigami2 CONFIG_PATH lib/cmake/KF6Kirigami2 DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(PACKAGE_NAME KF6KirigamiPlatform CONFIG_PATH lib/cmake/KF6KirigamiPlatform) + +# Remove debug files +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") +endif() + +# Handle copyright +vcpkg_install_copyright(FILE_LIST + "${SOURCE_PATH}/LICENSES/BSD-2-Clause.txt" + "${SOURCE_PATH}/LICENSES/BSD-3-Clause.txt" + "${SOURCE_PATH}/LICENSES/CC0-1.0.txt" + "${SOURCE_PATH}/LICENSES/FSFAP.txt" + "${SOURCE_PATH}/LICENSES/GPL-2.0-or-later.txt" + "${SOURCE_PATH}/LICENSES/LGPL-2.0-or-later.txt" + "${SOURCE_PATH}/LICENSES/LGPL-2.1-only.txt" + "${SOURCE_PATH}/LICENSES/LGPL-3.0-only.txt" + "${SOURCE_PATH}/LICENSES/LicenseRef-KDE-Accepted-LGPL.txt" + "${SOURCE_PATH}/LICENSES/MIT.txt" +) diff --git a/builds/vcpkg_overlay/kirigami/vcpkg.json b/builds/vcpkg_overlay/kirigami/vcpkg.json new file mode 100644 index 00000000..dc4f0f64 --- /dev/null +++ b/builds/vcpkg_overlay/kirigami/vcpkg.json @@ -0,0 +1,21 @@ +{ + "name": "kirigami", + "version": "6.20.0", + "port-version": 1, + "description": " A QtQuick based components set ", + "homepage": "https://github.com/KDE/kirigami", + "dependencies": [ + { + "name": "qtbase", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/builds/vcpkg_overlay/qtbase/portfile.cmake b/builds/vcpkg_overlay/qtbase/portfile.cmake new file mode 100644 index 00000000..4c3fe431 --- /dev/null +++ b/builds/vcpkg_overlay/qtbase/portfile.cmake @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company +# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only + +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/builds/vcpkg_overlay/qtbase/vcpkg.json b/builds/vcpkg_overlay/qtbase/vcpkg.json new file mode 100644 index 00000000..8b1c8d97 --- /dev/null +++ b/builds/vcpkg_overlay/qtbase/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "qtbase", + "version": "6.8.0", + "port-version": 2, + "features": { + "widgets": { + "description": "" + } + } +} diff --git a/cmake/CMakePresets.json.template b/cmake/CMakePresets.json.template new file mode 100644 index 00000000..4fe2ed4c --- /dev/null +++ b/cmake/CMakePresets.json.template @@ -0,0 +1,55 @@ +{ + "version": 4, + "cmakeMinimumRequired": { + "major": 3, + "minor": 23, + "patch": 0 + }, + "include": [ + "cmake/CMakePresetsUser.json" + ], + "configurePresets": [ + { + "name": "", + "displayName": "System environment", + "easyrpg_platforms": ["liblcf", "vcpkg", "vcpkg-liblcf"] + }, + { + "name": "windows", + "displayName": "Windows", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "easyrpg_platforms": ["liblcf"] + }, + { + "name": "windows-x64-vs2022", + "displayName": "Windows (x64) using Visual Studio 2022", + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "easyrpg_platforms": ["liblcf"] + }, + { + "name": "macos", + "displayName": "macOS", + "cacheVariables": { + "PLAYER_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/universal", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.9", + "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "easyrpg_platforms": ["liblcf", "vcpkg", "vcpkg-liblcf"] + } + ], + "buildPresets": [], + "testPresets": [] +} diff --git a/cmake/CMakePresetsBase.json b/cmake/CMakePresetsBase.json new file mode 100644 index 00000000..33e73f69 --- /dev/null +++ b/cmake/CMakePresetsBase.json @@ -0,0 +1,81 @@ +{ + "version": 4, + "configurePresets": [ + { + "name": "base", + "displayName": "base preset", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + } + }, + { + "name": "type-debug", + "displayName": "build Debug", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "type-relwithdebinfo", + "displayName": "build RelWithDebInfo", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "type-release", + "displayName": "build release", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "win-base", + "displayName": "windows base preset", + "hidden": true, + "toolchainFile": "$env{EASYRPG_BUILDSCRIPTS}/windows/vcpkg/scripts/buildsystems/vcpkg.cmake", + "cacheVariables": { + "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/windows/qt/6.10.1/msvc2022_64", + "VCPKG_OVERLAY_PORTS": "${sourceDir}/builds/vcpkg_overlay" + }, + "environment": { + "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/windows/qt/6.10.1/msvc2022_64" + }, + "inherits": ["base"], + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "build-liblcf", + "displayName": "build liblcf dependency", + "hidden": true, + "cacheVariables": { + "EDITOR_BUILD_LIBLCF": "ON" + } + }, + { + "name": "build-vcpkg", + "displayName": "build dependencies with vcpkg", + "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "hidden": true, + "cacheVariables": { + "VCPKG_OVERLAY_PORTS": "${sourceDir}/builds/vcpkg_overlay" + } + }, + { + "name": "build-vcpkg-liblcf", + "displayName": "build liblcf + dependencies with vcpkg", + "hidden": true, + "inherits": ["build-liblcf", "build-vcpkg"] + } + ] +} diff --git a/cmake/CMakePresetsUser.json b/cmake/CMakePresetsUser.json new file mode 100644 index 00000000..a553377a --- /dev/null +++ b/cmake/CMakePresetsUser.json @@ -0,0 +1,45 @@ +{ + "version": 4, + "include": [ + "CMakePresetsBase.json" + ], + "configurePresets": [ + { + "name": "base-user", + "displayName": "user overrides", + "hidden": true, + "inherits": ["base"], + "cacheVariables":{ + }, + "environment": { + "#EASYRPG_BUILDSCRIPTS": "/path/to/easyrpg/buildscripts" + }, + "vendor": { + "README": { + "line1": "Instead of setting an environment variable for the buildscripts you can alternatively", + "line2": "provide them here (in 'environment').", + "line3": "To use this remove the # and set the path for EASYRPG_BUILDSCRIPTS." + } + } + }, + { + "name": "win-user", + "displayName": "user overrides for Windows", + "hidden": true, + "cacheVariables": { + "#toolchainFile": "$env{EASYRPG_BUILDSCRIPTS}/windows/vcpkg/scripts/buildsystems/vcpkg.cmake", + "##toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake" + }, + "inherits": ["win-base"], + "vendor": { + "README": { + "line1": "Here you can provide a custom vcpkg root.", + "line2": "Two examples are given (in 'cacheVariables'):", + "line3": "The first is for a vcpkg from our buildscripts (that is the default).", + "line4": "The second is for a vcpkg inside of the Player repository.", + "line5": "To use one of them remove the # and set the path." + } + } + } + ] +} diff --git a/cmake/Modules/ConfigureWindows.cmake b/cmake/Modules/ConfigureWindows.cmake index cfded2a6..05530dd3 100644 --- a/cmake/Modules/ConfigureWindows.cmake +++ b/cmake/Modules/ConfigureWindows.cmake @@ -46,7 +46,7 @@ if(MSVC) endif() else() # Depends on vcpkg but we don't support anything else - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" CACHE STRING "") + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL" CACHE STRING "") endif() option(MSVC_MULTICORE "MSVC: Build using multiple cores (/MP)" ON) diff --git a/cmake/gen-cmake-presets.py b/cmake/gen-cmake-presets.py new file mode 100644 index 00000000..b1992bf0 --- /dev/null +++ b/cmake/gen-cmake-presets.py @@ -0,0 +1,130 @@ +#!/bin/env python3 + +# Script to generate all combinations for the CMakePresets.json +# Edit the CMakePresets.json.template and run this script +# License for the script and all json files including generated: Unlicense +# (c) Ghabry + +from copy import deepcopy +import json +import os + +script_dir = os.path.dirname(os.path.abspath(__file__)) +repo_dir = f"{script_dir}/.." + +with open(f"{script_dir}/CMakePresets.json.template", "r") as f: + j = json.load(f) + +conf_presets = j["configurePresets"] +conf_presets_out = [] + +def append_name(name): + if len(item["name"]) > 0: + item["name"] += "-" + item["name"] += name + +platform_display = dict( + sdl1="SDL1", + sdl2="SDL2", + sdl3="SDL3", + libretro="libretro core", + liblcf="build liblcf", + vcpkg="install deps with vcpkg" +) +platform_display["vcpkg-liblcf"] = "install deps with vcpkg + build liblcf" + +# This creates the following configurePresets from the one in the template: +# - As specified in the template +# - For every entry in easyrpg_platforms (N) +# For all of them the build types Debug, RelWithDebInfo and Release are generated. +# Making this (N+1) * 3 entries per preset. + +# The resulting "triplet" is always: +# {name_from_template}-{libretro}-{build_type} +# Omit libretro to disable it + +# The build dirs are always: +# build/{name_from_template}-{libretro}-{build_type} + +for base_item in conf_presets: + if base_item.get("hidden"): + conf_presets_out.append(base_item) + continue + + # Create "base class" the build types inherit from + item = deepcopy(base_item) + append_name("parent") + del item["displayName"] + item["hidden"] = True + + if item.get("inherits") is None: + item["inherits"] = "base-user" + + ep_platforms = ["default"] + if "easyrpg_platforms" in item: + ep_platforms += item["easyrpg_platforms"] + del item["easyrpg_platforms"] + + parent_item = deepcopy(item) + conf_presets_out.append(parent_item) + + for platform in ep_platforms: + # Ugly: Generates a huge amount of configurePresets + # Cannot be improved until limitations in buildPresets are resolved + # (see comment below) + for build_type in ["Debug", "RelWithDebInfo", "Release"]: + item = dict(name=base_item["name"], displayName=base_item["displayName"]) + name = item["name"] + + item["inherits"] = [parent_item["name"]] + + if platform != "default": + append_name(platform) + item["inherits"].insert(0, f"build-{platform}") + item["displayName"] += f" ({platform_display[platform]}, {build_type})" + else: + item["displayName"] += f" ({build_type})" + + item["inherits"] += [f"type-{build_type.lower()}"] + + append_name(build_type.lower()) + + conf_presets_out.append(item) + +j["configurePresets"] = conf_presets_out + +bp = j["buildPresets"] +for item in conf_presets_out: + if item.get("hidden"): + continue + + # Here it would make sense to provide the build types, however this will + # only work for Multi Config generators. + # Instead the build types are generated as part of the configurePreset. + # Code kept for reference in case CMake improves this in a later version. + + #for build_type in ["Debug", "RelWithDebInfo", "Release", "MinSizeRel"]: + # name = item["name"] + f"-{build_type.lower()}" + # conf_preset = item["name"] + # bp.append(dict( + # name=name, + # displayName=build_type, + # configurePreset=conf_preset, + # configuration=build_type)) + + bp.append(dict(name=item["name"], configurePreset=item["name"])) + +# Add note that the file is auto-generated to the beginning +vendor = dict(vendor=dict( + README=dict( + line1="!!! GENERATED FILE. DO NOT EDIT !!!", + line2="Modify builds/cmake/CMakePresets.json.template instead", + line3="and run gen-cmake-presets.py to regenerate this file." + ) +)) + +j = {**vendor, **j} + +with open(f"{repo_dir}/CMakePresets.json", "w") as f: + json.dump(j, f, indent='\t') + f.write("\n") diff --git a/src/qmlbinding/empty.h b/src/qmlbinding/empty.h new file mode 100644 index 00000000..e69de29b diff --git a/src/ui/MainPage.qml b/src/ui/MainPage.qml deleted file mode 100644 index caba429b..00000000 --- a/src/ui/MainPage.qml +++ /dev/null @@ -1,29 +0,0 @@ -// Includes relevant modules used by the QML -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls as Controls -import org.kde.kirigami as Kirigami - -// Provides basic features needed for all kirigami applications -Kirigami.ApplicationWindow { - // Unique identifier to reference this object - id: root - - width: 400 - height: 300 - - // Window title - // i18nc() makes a string translatable - // and provides additional context for the translators - title: "Hello World" - - // Set the first page that will be loaded when the app opens - // This can also be set to an id of a Kirigami.Page - pageStack.initialPage: Kirigami.Page { - Controls.Label { - // Center label horizontally and vertically within parent object - anchors.centerIn: parent - text: "Hello World!" - } - } -} diff --git a/src/ui/MainWindow.qml b/src/ui/MainWindow.qml new file mode 100644 index 00000000..8dcfcfa8 --- /dev/null +++ b/src/ui/MainWindow.qml @@ -0,0 +1,21 @@ +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as Controls +import QtQuick.Dialogs as Dialogs +import org.kde.kirigami as Kirigami +import org.easyrpg.editor as EasyRPG + +Kirigami.ApplicationWindow { + id: root + + width: 1024 + height: 600 + + title: "Hello World" + + pageStack { + initialPage: pageRoot + columnView.interactive: true + //columnView.interactiveResizeEnabled: true + } +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000..fa344115 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "easyrpg-editor", + "version": "1.0.0", + "dependencies": [ + "zlib", + { + "name": "inih", + "features": ["cpp"] + }, + "ecm", + "kddockwidgets", + "kirigami", + "glaze" + ] +} From 71dc925337e52c23066b38cd0b378a92675d73e4 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 18 Feb 2026 15:16:47 +0100 Subject: [PATCH 06/21] Remove Music Player Most of the code had to be commented out to make it compile with Qt6 The Player was a copy-paste from a Qt example and never utilized. Can be reimplemented properly later (e.g. using the Player Audio Decoder) --- CMakeLists.txt | 4 - src/ui/main_window.cpp | 13 +- src/ui/main_window.h | 1 - src/ui/other/musicplayer.cpp | 262 ---------------------------------- src/ui/other/musicplayer.h | 111 -------------- src/ui/other/volumebutton.cpp | 111 -------------- src/ui/other/volumebutton.h | 89 ------------ 7 files changed, 1 insertion(+), 590 deletions(-) delete mode 100644 src/ui/other/musicplayer.cpp delete mode 100644 src/ui/other/musicplayer.h delete mode 100644 src/ui/other/volumebutton.cpp delete mode 100644 src/ui/other/volumebutton.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fbac7ac4..a1dc2022 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,8 +279,6 @@ set(EDITOR_SOURCES src/ui/other/import_project_dialog.cpp src/ui/other/import_project_dialog.h src/ui/other/import_project_dialog.ui - src/ui/other/musicplayer.cpp - src/ui/other/musicplayer.h src/ui/other/new_project_dialog.cpp src/ui/other/new_project_dialog.h src/ui/other/new_project_dialog.ui @@ -299,8 +297,6 @@ set(EDITOR_SOURCES src/ui/other/search_dialog.cpp src/ui/other/search_dialog.h src/ui/other/search_dialog.ui - src/ui/other/volumebutton.cpp - src/ui/other/volumebutton.h src/ui/picker/picker_audio_widget.cpp src/ui/picker/picker_audio_widget.h src/ui/picker/picker_audio_widget.ui diff --git a/src/ui/main_window.cpp b/src/ui/main_window.cpp index 93d38369..608246f8 100644 --- a/src/ui/main_window.cpp +++ b/src/ui/main_window.cpp @@ -798,18 +798,7 @@ void MainWindow::on_actionProjectOpen_triggered() void MainWindow::on_actionJukebox_triggered(bool disconnect) { - static MusicPlayer player; - if (disconnect) - { - player.disconnect(); - player.deleteLater(); - player.close(); - } - else - { - player.resize(300, 60); - player.show(); - } + } void MainWindow::on_actionLayerLower_triggered() diff --git a/src/ui/main_window.h b/src/ui/main_window.h index 8675c780..beac8d2d 100644 --- a/src/ui/main_window.h +++ b/src/ui/main_window.h @@ -26,7 +26,6 @@ #include "ui/other/search_dialog.h" #include "ui/map/map_scene.h" #include "ui/common/palette_scene.h" -#include "ui/other/musicplayer.h" namespace Ui { class MainWindow; diff --git a/src/ui/other/musicplayer.cpp b/src/ui/other/musicplayer.cpp deleted file mode 100644 index 8cd0c6dc..00000000 --- a/src/ui/other/musicplayer.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* - * This file is part of EasyRPG Editor. - * - * EasyRPG Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * EasyRPG Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with EasyRPG Editor. If not, see . - */ - -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "musicplayer.h" -#include "volumebutton.h" - -#include -#include -#include - - -MusicPlayer::MusicPlayer(QWidget *parent) : QWidget(parent), - mediaPlayer(nullptr), - playButton(nullptr), - volumeButton(nullptr), - positionSlider(nullptr), - positionLabel(nullptr), - infoLabel(nullptr) -{ - createWidgets(); - createShortcuts(); - - connect(&mediaPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(updatePosition(qint64))); - connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(updateDuration(qint64))); - connect(&mediaPlayer, SIGNAL(metaDataAvailableChanged(bool)), this, SLOT(updateInfo())); - connect(&mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(handleError())); - //connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), - // this, SLOT(updateState(QMediaPlayer::State))); -} - -void MusicPlayer::openFile() -{ - static QString path = QDir::homePath(); - QString filePath = QFileDialog::getOpenFileName(this, tr("Open File"), path, tr("All files (*.*)")); - if (!filePath.isEmpty()) { - path = filePath; - playFile(filePath); - } -} - -void MusicPlayer::playFile(const QString &filePath) -{ - playButton->setEnabled(true); - infoLabel->setText(QFileInfo(filePath).fileName()); - - //mediaPlayer.setMedia(QUrl::fromLocalFile(filePath)); - mediaPlayer.play(); -} - -void MusicPlayer::togglePlayback() -{ - /*if (mediaPlayer.mediaStatus() == QMediaPlayer::NoMedia) - openFile(); - else if (mediaPlayer.state() == QMediaPlayer::PlayingState) - mediaPlayer.pause(); - else - mediaPlayer.play();*/ -} - -void MusicPlayer::seekForward() -{ - positionSlider->triggerAction(QSlider::SliderPageStepAdd); -} - -void MusicPlayer::seekBackward() -{ - positionSlider->triggerAction(QSlider::SliderPageStepSub); -} - -bool MusicPlayer::event(QEvent *event) -{ - return QWidget::event(event); -} - -void MusicPlayer::mousePressEvent(QMouseEvent *event) -{ - offset = event->globalPos() - pos(); - event->accept(); -} - -void MusicPlayer::mouseMoveEvent(QMouseEvent *event) -{ - move(event->globalPos() - offset); - event->accept(); -} - -void MusicPlayer::mouseReleaseEvent(QMouseEvent *event) -{ - offset = QPoint(); - event->accept(); -} -/* -void MusicPlayer::updateState(QMediaPlayer::State state) -{ - if (state == QMediaPlayer::PlayingState) { - playButton->setToolTip(tr("Pause")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPause)); - } else { - playButton->setToolTip(tr("Play")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - } -} -*/ -void MusicPlayer::updatePosition(qint64 position) -{ - positionSlider->setValue(static_cast(position)); - - QTime duration(0, static_cast(position / 60000), qRound((position % 60000) / 1000.0)); - positionLabel->setText(duration.toString(tr("mm:ss"))); -} - -void MusicPlayer::updateDuration(qint64 duration) -{ - positionSlider->setRange(0, static_cast(duration)); - positionSlider->setEnabled(duration > 0); - positionSlider->setPageStep(static_cast(duration / 10)); -} - -void MusicPlayer::setPosition(int position) -{ - // avoid seeking when the slider value change is triggered from updatePosition() - if (qAbs(mediaPlayer.position() - position) > 99) - mediaPlayer.setPosition(position); -} - -void MusicPlayer::updateInfo() -{ - /*QStringList info; - QString author = mediaPlayer.metaData("Author").toString(); - if (!author.isEmpty()) - info += author; - QString title = mediaPlayer.metaData("Title").toString(); - if (!title.isEmpty()) - info += title; - if (!info.isEmpty()) - infoLabel->setText(info.join(tr(" - ")));*/ -} - -void MusicPlayer::handleError() -{ - playButton->setEnabled(false); - infoLabel->setText(tr("Error: %1").arg(mediaPlayer.errorString())); -} - -void MusicPlayer::createWidgets() -{ - playButton = new QToolButton(this); - playButton->setEnabled(false); - playButton->setToolTip(tr("Play")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - connect(playButton, SIGNAL(clicked()), this, SLOT(togglePlayback())); - - QAbstractButton *openButton = new QToolButton(this); - openButton->setText(tr("...")); - openButton->setToolTip(tr("Open a file...")); - openButton->setFixedSize(playButton->sizeHint()); - connect(openButton, SIGNAL(clicked()), this, SLOT(openFile())); - - volumeButton = new VolumeButton(this); - volumeButton->setToolTip(tr("Adjust volume")); - //volumeButton->setVolume(mediaPlayer.volume()); - connect(volumeButton, SIGNAL(volumeChanged(int)), &mediaPlayer, SLOT(setVolume(int))); - - positionSlider = new QSlider(Qt::Horizontal, this); - positionSlider->setEnabled(false); - positionSlider->setToolTip(tr("Seek")); - connect(positionSlider, SIGNAL(valueChanged(int)), this, SLOT(setPosition(int))); - - infoLabel = new QLabel(this); - positionLabel = new QLabel(tr("00:00"), this); - positionLabel->setMinimumWidth(positionLabel->sizeHint().width()); - - QBoxLayout *controlLayout = new QHBoxLayout; - //controlLayout->setMargin(0); - controlLayout->addWidget(openButton); - controlLayout->addWidget(playButton); - controlLayout->addWidget(positionSlider); - controlLayout->addWidget(positionLabel); - controlLayout->addWidget(volumeButton); - - QBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->addWidget(infoLabel); - mainLayout->addLayout(controlLayout); -} - -void MusicPlayer::createShortcuts() -{ - QShortcut *quitShortcut = new QShortcut(QKeySequence::Quit, this); - connect(quitShortcut, SIGNAL(activated()), qApp, SLOT(quit())); - - QShortcut *openShortcut = new QShortcut(QKeySequence::Open, this); - connect(openShortcut, SIGNAL(activated()), this, SLOT(openFile())); - - QShortcut *toggleShortcut = new QShortcut(Qt::Key_Space, this); - connect(toggleShortcut, SIGNAL(activated()), this, SLOT(togglePlayback())); - - QShortcut *forwardShortcut = new QShortcut(Qt::Key_Right, this); - connect(forwardShortcut, SIGNAL(activated()), this, SLOT(seekForward())); - - QShortcut *backwardShortcut = new QShortcut(Qt::Key_Left, this); - connect(backwardShortcut, SIGNAL(activated()), this, SLOT(seekBackward())); - - QShortcut *increaseShortcut = new QShortcut(Qt::Key_Up, this); - connect(increaseShortcut, SIGNAL(activated()), volumeButton, SLOT(increaseVolume())); - - QShortcut *decreaseShortcut = new QShortcut(Qt::Key_Down, this); - connect(decreaseShortcut, SIGNAL(activated()), volumeButton, SLOT(descreaseVolume())); -} diff --git a/src/ui/other/musicplayer.h b/src/ui/other/musicplayer.h deleted file mode 100644 index 0ae8a8f2..00000000 --- a/src/ui/other/musicplayer.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * This file is part of EasyRPG Editor. - * - * EasyRPG Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * EasyRPG Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with EasyRPG Editor. If not, see . - */ - -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#pragma once - -#include -#include - -class VolumeButton; - -QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QSlider) -QT_FORWARD_DECLARE_CLASS(QAbstractButton) - -class MusicPlayer : public QWidget -{ - Q_OBJECT -public: - MusicPlayer(QWidget *parent = nullptr); - -public slots: - void openFile(); - void playFile(const QString& filePath); - void togglePlayback(); - void seekForward(); - void seekBackward(); - -protected: - bool event(QEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - -private slots: - //void updateState(QMediaPlayer::State state); - void updatePosition(qint64 position); - void updateDuration(qint64 duration); - void setPosition(int position); - void updateInfo(); - void handleError(); - -private: - void createWidgets(); - void createShortcuts(); - void createJumpList(); - void createTaskbar(); - void createThumbnailToolBar(); - - QMediaPlayer mediaPlayer; - QAbstractButton *playButton; - VolumeButton *volumeButton; - QSlider *positionSlider; - QLabel *positionLabel; - QLabel *infoLabel; - QPoint offset; -}; - diff --git a/src/ui/other/volumebutton.cpp b/src/ui/other/volumebutton.cpp deleted file mode 100644 index 9a30f23c..00000000 --- a/src/ui/other/volumebutton.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * This file is part of EasyRPG Editor. - * - * EasyRPG Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * EasyRPG Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with EasyRPG Editor. If not, see . - */ - -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "volumebutton.h" - -#include - -VolumeButton::VolumeButton(QWidget *parent) : - QToolButton(parent), menu(nullptr), label(nullptr), slider(nullptr) -{ - setIcon(style()->standardIcon(QStyle::SP_MediaVolume)); - setPopupMode(QToolButton::InstantPopup); - - QWidget *popup = new QWidget(this); - - slider = new QSlider(Qt::Horizontal, popup); - slider->setRange(0, 100); - connect(slider, SIGNAL(valueChanged(int)), this, SIGNAL(volumeChanged(int))); - - label = new QLabel(popup); - label->setAlignment(Qt::AlignCenter); - label->setNum(100); - label->setMinimumWidth(label->sizeHint().width()); - connect(slider, SIGNAL(valueChanged(int)), label, SLOT(setNum(int))); - - QBoxLayout *popupLayout = new QHBoxLayout(popup); - //popupLayout->setMargin(2); - popupLayout->addWidget(slider); - popupLayout->addWidget(label); - - QWidgetAction *action = new QWidgetAction(this); - action->setDefaultWidget(popup); - - menu = new QMenu(this); - menu->addAction(action); - setMenu(menu); -} - -void VolumeButton::increaseVolume() -{ - slider->triggerAction(QSlider::SliderPageStepAdd); -} - -void VolumeButton::descreaseVolume() -{ - slider->triggerAction(QSlider::SliderPageStepSub); -} - -int VolumeButton::volume() const -{ - return slider->value(); -} - -void VolumeButton::setVolume(int volume) -{ - slider->setValue(volume); -} diff --git a/src/ui/other/volumebutton.h b/src/ui/other/volumebutton.h deleted file mode 100644 index 3b8503eb..00000000 --- a/src/ui/other/volumebutton.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This file is part of EasyRPG Editor. - * - * EasyRPG Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * EasyRPG Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with EasyRPG Editor. If not, see . - */ - -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#pragma once - -#include - -QT_FORWARD_DECLARE_CLASS(QMenu) -QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QSlider) - -class VolumeButton : public QToolButton -{ - Q_OBJECT - Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) - -public: - VolumeButton(QWidget *parent = nullptr); - - int volume() const; - -public slots: - void increaseVolume(); - void descreaseVolume(); - void setVolume(int volume); - -signals: - void volumeChanged(int volume); - -private: - QMenu *menu; - QLabel *label; - QSlider *slider; -}; - From 03f095f84c1f212f419f724dec672d1a795739dd Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 18 Feb 2026 15:21:16 +0100 Subject: [PATCH 07/21] vcpkg: Add missing expat library (required by lcf) --- vcpkg.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index fa344115..c7657902 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,8 +8,9 @@ "features": ["cpp"] }, "ecm", + "expat", + "glaze", "kddockwidgets", - "kirigami", - "glaze" + "kirigami" ] } From 82e892370330f6b325c4032a4c11ff326a704f1c Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 18 Feb 2026 15:29:38 +0100 Subject: [PATCH 08/21] CMake Presets: Use custom triplet on Windows --- CMakePresets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 3df0993a..2f1992db 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -129,7 +129,7 @@ { "name": "windows-parent", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-md" + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" }, "inherits": "win-user", "hidden": true @@ -190,7 +190,7 @@ "generator": "Visual Studio 17 2022", "architecture": "x64", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-static-md" + "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" }, "inherits": "win-user", "hidden": true From 8526041dd3ab62b6f52e03baee130b088cbbf1cf Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 18 Feb 2026 16:22:35 +0100 Subject: [PATCH 09/21] CMake: Add qt deployment script --- CMakeLists.txt | 51 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1dc2022..ae45b2ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -333,6 +333,18 @@ set(EDITOR_QML_INTERFACE src/qmlbinding/empty.h ) +# Dependencies +find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg QuickControls2) +find_package(Qt6LinguistTools CONFIG QUIET) +find_package(ZLIB REQUIRED) +find_package(glaze REQUIRED) +find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS Kirigami) + +qt_standard_project_setup( + REQUIRES "6.10.1" +) + +# Executable if(APPLE) # Do not code sign set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") @@ -345,13 +357,13 @@ if(APPLE) set(EXE_NAME "EasyRPG-Editor.app") set(EXE_OUTPUT_NAME "EasyRPG Editor") - add_executable(${EXE_NAME} MACOSX_BUNDLE "src/main.cpp" ${EDITOR_SOURCES} ${EDITOR_BUNDLE_ICON}) + qt_add_executable(${EXE_NAME} MACOSX_BUNDLE "src/main.cpp" ${EDITOR_SOURCES} ${EDITOR_BUNDLE_ICON} MANUAL_FINALIZATION) set_target_properties(${EXE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resources/app/Info.plist.in") set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME ${EXE_OUTPUT_NAME}) else() # Executable set(EXE_NAME ${PROJECT_NAME}) - add_executable(${EXE_NAME} WIN32 "src/main.cpp" ${EDITOR_SOURCES}) + qt_add_executable(${EXE_NAME} WIN32 "src/main.cpp" ${EDITOR_SOURCES} MANUAL_FINALIZATION) if(WIN32) # Open console for Debug builds if(CMAKE_BUILD_TYPE MATCHES "Debug") @@ -399,12 +411,6 @@ set_target_properties(${EXE_NAME} PROPERTIES ) set(CMAKE_INCLUDE_CURRENT_DIR ON) -find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg QuickControls2) -find_package(Qt6LinguistTools CONFIG QUIET) -find_package(ZLIB REQUIRED) -find_package(glaze REQUIRED) -find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS Kirigami) - include(ECMQmlModule) include(ECMFindQmlModule) @@ -489,30 +495,13 @@ else() message(STATUS "Disabling translation support") endif() +qt_finalize_target(${EXE_NAME}) + # Installation include(GNUInstallDirs) if(APPLE) - # Find Qt deployment apps - get_target_property(_QMAKE_EXECUTABLE Qt6::qmake IMPORTED_LOCATION) - get_filename_component(_QT_BIN_DIR "${_QMAKE_EXECUTABLE}" DIRECTORY) - find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_QT_BIN_DIR}") - set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}) install(TARGETS ${EXE_NAME} RUNTIME DESTINATION BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/Package") - # Run macdeployqt - install(CODE " - execute_process(COMMAND - ${MACDEPLOYQT_EXECUTABLE} - \"${CMAKE_BINARY_DIR}/Package/${EXE_OUTPUT_NAME}.app\" - -always-overwrite - ) - ") - # Run cmake fixup_bundle to fix runpath for any non-Qt dylibs and to verify - install(CODE " - include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS TRUE) - fixup_bundle(\"${CMAKE_BINARY_DIR}/Package/${EXE_OUTPUT_NAME}.app\" \"\" \"\") - " COMPONENT RUNTIME) else() install(TARGETS ${EXE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -534,3 +523,11 @@ else() # DESTINATION ${CMAKE_INSTALL_DATADIR}/appdata) endif() endif() + +# Generate a deployment script to be executed at install time +qt_generate_deploy_qml_app_script( + TARGET ${EXE_NAME} + OUTPUT_SCRIPT deploy_script + MACOS_BUNDLE_POST_BUILD +) +install(SCRIPT ${deploy_script}) From 75839da673cebf362f995d12c1f42252267f3f7b Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 18 Feb 2026 16:22:50 +0100 Subject: [PATCH 10/21] Fix startup --- src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d4bf69b7..c8e49292 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) QPixmap logo(":/app/splash.png"); QSplashScreen s(logo, Qt::WindowStaysOnTopHint); s.showMessage("EasyRPG Editor"); - //s.show(); + s.show(); #ifdef NDEBUG // close splash after 3 seconds for release QTimer::singleShot(3000, &s, &QWidget::close); @@ -41,13 +41,13 @@ int main(int argc, char *argv[]) a.setOrganizationName("EasyRPG"); a.setOrganizationDomain("easyrpg.org"); - qputenv("QML_IMPORT_TRACE", "1"); + // setup qml engine QQmlApplicationEngine engine; - engine.loadFromModule("org.easyrpg.editor", "MainPage"); + engine.loadFromModule("org.easyrpg.editor", "MainWindow"); - if (engine.rootObjects().isEmpty()) { - return -1; - } + if (engine.rootObjects().isEmpty()) { + return -1; + } // load translations s.showMessage("Loading translations..."); From ef8adef6d0cd5c3f5832392f53b339c0519f7112 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 18 Feb 2026 16:25:15 +0100 Subject: [PATCH 11/21] CMake: Only run deployment script on Windows and Apple --- CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae45b2ca..28f25d1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -525,9 +525,12 @@ else() endif() # Generate a deployment script to be executed at install time -qt_generate_deploy_qml_app_script( - TARGET ${EXE_NAME} - OUTPUT_SCRIPT deploy_script - MACOS_BUNDLE_POST_BUILD -) -install(SCRIPT ${deploy_script}) +if(WIN32 OR APPLE) + # The script fails on Linux currently + qt_generate_deploy_qml_app_script( + TARGET ${EXE_NAME} + OUTPUT_SCRIPT deploy_script + MACOS_BUNDLE_POST_BUILD + ) + install(SCRIPT ${deploy_script}) +endif() From 4a2a17451fb3fc3607d6a5859e6f0874bb76d792 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 20 Feb 2026 11:17:42 +0100 Subject: [PATCH 12/21] More maintanance work to improve Windows support The editor runs now directly from Visual Studio Installation can deploy all the required dependencies Added a setup-env script to handle non VS development Updates kddockwidgets to latest version --- .gitignore | 3 +- CMakeLists.txt | 34 ++++++++++- .../kddockwidgets/portfile.cmake | 16 ++++- builds/vcpkg_overlay/kddockwidgets/vcpkg.json | 30 +++++++--- cmake/CMakePresets.json.template | 4 +- cmake/CMakePresetsBase.json | 1 + cmake/Modules/ConfigureWindows.cmake | 59 ------------------- cmake/Modules/EditorConfigureWindows.cmake | 38 ++++++++++++ cmake/gen-cmake-presets.py | 5 ++ cmake/setup_env.cmd.in | 3 + 10 files changed, 119 insertions(+), 74 deletions(-) delete mode 100644 cmake/Modules/ConfigureWindows.cmake create mode 100644 cmake/Modules/EditorConfigureWindows.cmake create mode 100644 cmake/setup_env.cmd.in diff --git a/.gitignore b/.gitignore index 30587992..83958be5 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,8 @@ cmake_install.cmake *automoc.cpp .cmake/ cmake-build-*/ +build/ +install/ # Ninja *.ninja @@ -54,7 +56,6 @@ cmake-build-*/ # Visual Studio Code .vscode/ .cache/ -build/ # Mac .DS_Store diff --git a/CMakeLists.txt b/CMakeLists.txt index 28f25d1d..5e81f676 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(KF_DEP_VERSION "6.11.0") # Extra CMake Module files find_package(ECM ${KF_DEP_VERSION} REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ${ECM_MODULE_PATH}) -include(ConfigureWindows) +include(EditorConfigureWindows) # Dependencies provided by CMake Presets option(EDITOR_FIND_ROOT_PATH_APPEND "When enabled the items from CMAKE_PREFIX_PATH are added to CMAKE_FIND_ROOT_PATH. Works around problematic CMake Toolchain files" OFF) @@ -334,7 +334,7 @@ set(EDITOR_QML_INTERFACE ) # Dependencies -find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg QuickControls2) +find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui GuiPrivate Svg QuickControls2) find_package(Qt6LinguistTools CONFIG QUIET) find_package(ZLIB REQUIRED) find_package(glaze REQUIRED) @@ -372,6 +372,8 @@ else() set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "Editor") # Add icon target_sources(${EXE_NAME} PRIVATE "resources/Resources.rc") + # Set Visual Studio startup project + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${EXE_NAME}) else() set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "easyrpg-editor") endif() @@ -426,7 +428,7 @@ ecm_target_qml_sources(${EXE_NAME} SOURCES ${EDITOR_QML_UI} ) -ecm_find_qmlmodule(org.kde.kitemmodels 1.0) +#ecm_find_qmlmodule(org.kde.kirigami 6.20 REQUIRED) # liblcf option(EDITOR_BUILD_LIBLCF "Instead of detecting liblcf the liblcf repository is cloned into lib/liblcf and built together with the Player. This is convenient for development" OFF) @@ -469,6 +471,8 @@ target_link_libraries(${EXE_NAME} PRIVATE Qt6::Multimedia Qt6::Svg Qt6::QuickControls2 + KF6::Kirigami + KF6::KirigamiPlatform ) # Add resources @@ -499,6 +503,7 @@ qt_finalize_target(${EXE_NAME}) # Installation include(GNUInstallDirs) + if(APPLE) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}) install(TARGETS ${EXE_NAME} RUNTIME DESTINATION BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/Package") @@ -527,6 +532,7 @@ endif() # Generate a deployment script to be executed at install time if(WIN32 OR APPLE) # The script fails on Linux currently + # Untested on macOS qt_generate_deploy_qml_app_script( TARGET ${EXE_NAME} OUTPUT_SCRIPT deploy_script @@ -534,3 +540,25 @@ if(WIN32 OR APPLE) ) install(SCRIPT ${deploy_script}) endif() + +if(WIN32) + # Copy DLL dependencies + install( + DIRECTORY ${VCPKG_DIR}/bin/ + DESTINATION ${CMAKE_INSTALL_BINDIR} + FILES_MATCHING + PATTERN "*.dll" + ) + # Copy Kirigami QML + install(DIRECTORY ${VCPKG_DIR}/lib/qml/ DESTINATION qml) + + # Environment for the MSVC Debugger + set_target_properties(${EXE_NAME} + PROPERTIES VS_DEBUGGER_ENVIRONMENT + "PATH=${VCPKG_DIR}/bin;$ENV{Qt6_Path}/bin;%PATH%\nQML2_IMPORT_PATH=${VCPKG_DIR}/lib/qml" + ) + + # Other dev environments + configure_file("cmake/setup_env.cmd.in" "setup_env.cmd") + message(STATUS "When not using Visual Studio for development run setup_env.cmd to configure the environment") +endif() diff --git a/builds/vcpkg_overlay/kddockwidgets/portfile.cmake b/builds/vcpkg_overlay/kddockwidgets/portfile.cmake index 9a927453..ce241e0e 100644 --- a/builds/vcpkg_overlay/kddockwidgets/portfile.cmake +++ b/builds/vcpkg_overlay/kddockwidgets/portfile.cmake @@ -1,3 +1,17 @@ +if("qtwidgets" IN_LIST FEATURES) + list(APPEND FRONTEND_LIST "qtwidgets") +endif() + +if("qtquick" IN_LIST FEATURES) + list(APPEND FRONTEND_LIST "qtquick") +endif() + +if(FRONTEND_LIST) + list(JOIN FRONTEND_LIST ";" FRONTENDS) +else() + message(FATAL_ERROR "No front-ends selected for ${PORT}, cannot build package") +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KDAB/KDDockWidgets @@ -23,7 +37,7 @@ vcpkg_cmake_configure( OPTIONS ${_qarg_OPTIONS} -DKDDockWidgets_QT6=ON - -DKDDockWidgets_FRONTENDS=qtquick + "-DKDDockWidgets_FRONTENDS=${FRONTENDS}" -DKDDockWidgets_STATIC=${KD_STATIC} -DKDDockWidgets_PYTHON_BINDINGS=OFF -DKDDockWidgets_TESTS=OFF diff --git a/builds/vcpkg_overlay/kddockwidgets/vcpkg.json b/builds/vcpkg_overlay/kddockwidgets/vcpkg.json index 2aa56671..d35d21bf 100644 --- a/builds/vcpkg_overlay/kddockwidgets/vcpkg.json +++ b/builds/vcpkg_overlay/kddockwidgets/vcpkg.json @@ -5,16 +5,10 @@ "description": "KDAB's Dock Widget Framework for Qt", "homepage": "https://www.kdab.com/development-resources/qt-tools/kddockwidgets/", "license": "GPL-2.0-only OR GPL-3.0-only", + "supports": "!android & !ios", "dependencies": [ "kdbindings", "nlohmann-json", - { - "name": "qtbase", - "default-features": false, - "features": [ - "widgets" - ] - }, { "name": "vcpkg-cmake", "host": true @@ -23,5 +17,25 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "default-features": [ + "qtwidgets" + ], + "features": { + "qtquick": { + "description": "Build for Qt Quick frontend" + }, + "qtwidgets": { + "description": "Build for Qt Widgets frontend", + "dependencies": [ + { + "name": "qtbase", + "default-features": false, + "features": [ + "widgets" + ] + } + ] + } + } } diff --git a/cmake/CMakePresets.json.template b/cmake/CMakePresets.json.template index 4fe2ed4c..5d1c9b03 100644 --- a/cmake/CMakePresets.json.template +++ b/cmake/CMakePresets.json.template @@ -18,7 +18,7 @@ "name": "windows", "displayName": "Windows", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-shared-easyrpgeditor" }, "inherits": "win-user", "easyrpg_platforms": ["liblcf"] @@ -29,7 +29,7 @@ "generator": "Visual Studio 17 2022", "architecture": "x64", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "x64-windows-shared-easyrpgeditor" }, "inherits": "win-user", "easyrpg_platforms": ["liblcf"] diff --git a/cmake/CMakePresetsBase.json b/cmake/CMakePresetsBase.json index 33e73f69..71cb8115 100644 --- a/cmake/CMakePresetsBase.json +++ b/cmake/CMakePresetsBase.json @@ -7,6 +7,7 @@ "hidden": true, "generator": "Ninja", "binaryDir": "${sourceDir}/build/${presetName}", + "installDir": "${sourceDir}/install/${presetName}", "cacheVariables": { "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" } diff --git a/cmake/Modules/ConfigureWindows.cmake b/cmake/Modules/ConfigureWindows.cmake deleted file mode 100644 index 05530dd3..00000000 --- a/cmake/Modules/ConfigureWindows.cmake +++ /dev/null @@ -1,59 +0,0 @@ -if(WIN32) - # Target Unicode API - add_definitions(-D_UNICODE) - add_definitions(-DUNICODE) - - # Disable API deprecation warnings - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - - # Prevent some Windows.h global namespace pollution - add_definitions(-DNOMINMAX) - add_definitions(-DWIN32_LEAN_AND_MEAN) -endif() - -if(MSVC) - if(${CMAKE_VERSION} VERSION_LESS "3.15.0") - message(WARNING "Your CMake version is older than 3.15") - message(WARNING "For proper MSVC runtime library support upgrade to a newer version") - - option(SHARED_RUNTIME "Windows: Build using the shared runtime library (/MD), disable for static runtime (/MT)" ON) - - # Set compiler options. - set(variables - CMAKE_C_FLAGS_DEBUG - CMAKE_C_FLAGS_MINSIZEREL - CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS_DEBUG - CMAKE_CXX_FLAGS_MINSIZEREL - CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_RELWITHDEBINFO - ) - if(SHARED_RUNTIME) - message(STATUS "Windows: Using dynamic runtime library (/MD)") - foreach(variable ${variables}) - if(${variable} MATCHES "/MT") - string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}") - endif() - endforeach() - else() - message(STATUS "Windows: Using static runtime library (/MT)") - foreach(variable ${variables}) - if(${variable} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}") - endif() - endforeach() - endif() - else() - # Depends on vcpkg but we don't support anything else - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL" CACHE STRING "") - endif() - - option(MSVC_MULTICORE "MSVC: Build using multiple cores (/MP)" ON) - if (MSVC_MULTICORE) - add_compile_options("/MP") - endif() - - # Interpret character literals as UTF-8 - add_compile_options("/utf-8") -endif() diff --git a/cmake/Modules/EditorConfigureWindows.cmake b/cmake/Modules/EditorConfigureWindows.cmake new file mode 100644 index 00000000..66949686 --- /dev/null +++ b/cmake/Modules/EditorConfigureWindows.cmake @@ -0,0 +1,38 @@ +if(WIN32) + # Target Unicode API + add_compile_definitions(_UNICODE UNICODE) + + # Disable API deprecation warnings + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) + + # Prevent some Windows.h global namespace pollution + add_compile_definitions(NOMINMAX WIN32_LEAN_AND_MEAN) + + # Make math constants available + add_compile_definitions(_USE_MATH_DEFINES) +endif() + +if(MSVC) + # Depends on vcpkg but we don't support anything else + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL" CACHE STRING "") + + option(MSVC_MULTICORE "MSVC: Build using multiple cores (/MP)" ON) + if (MSVC_MULTICORE) + add_compile_options("/MP") + endif() + + # Interpret character literals as UTF-8 + add_compile_options("/utf-8") +endif() + +if (CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_CONFIGURATION_TYPES) + # Multi-Config is not supported due to limitations in the CMake Find Scripts + # Remove all configuration types except the current build type + set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE}) +endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(VCPKG_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug") +else() + set(VCPKG_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}") +endif() diff --git a/cmake/gen-cmake-presets.py b/cmake/gen-cmake-presets.py index b1992bf0..c8206dd2 100644 --- a/cmake/gen-cmake-presets.py +++ b/cmake/gen-cmake-presets.py @@ -85,6 +85,11 @@ def append_name(name): else: item["displayName"] += f" ({build_type})" + if "windows" in name: + # Hack: The MSVC Linker does not support long paths + # Shorten the build folder name to "win" + item["binaryDir"] = "${sourceDir}/build/win-" + build_type.lower() + item["inherits"] += [f"type-{build_type.lower()}"] append_name(build_type.lower()) diff --git a/cmake/setup_env.cmd.in b/cmake/setup_env.cmd.in new file mode 100644 index 00000000..261827cb --- /dev/null +++ b/cmake/setup_env.cmd.in @@ -0,0 +1,3 @@ +@echo off +set PATH=${VCPKG_DIR}/bin;$ENV{Qt6_Path}\\bin;%PATH% +echo Environment configured for EasyRPG Editor \ No newline at end of file From caa6dd2c2d5beb9dc1f8b1bd2ed75cdc35013fc1 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 20 Feb 2026 15:47:01 +0100 Subject: [PATCH 13/21] Changes for macOS. Currently only the macos-vcpkg preset is supported --- CMakeLists.txt | 26 +++++----- CMakePresets.json | 49 ++++++++++++------- .../kddockwidgets/portfile.cmake | 2 +- builds/vcpkg_overlay/kirigami/portfile.cmake | 4 ++ cmake/CMakePresets.json.template | 9 ++-- src/main.cpp | 6 ++- vcpkg.json | 4 +- 7 files changed, 63 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e81f676..17ddd8c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -334,7 +334,7 @@ set(EDITOR_QML_INTERFACE ) # Dependencies -find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui GuiPrivate Svg QuickControls2) +find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg QuickControls2) find_package(Qt6LinguistTools CONFIG QUIET) find_package(ZLIB REQUIRED) find_package(glaze REQUIRED) @@ -417,7 +417,7 @@ include(ECMQmlModule) include(ECMFindQmlModule) ecm_add_qml_module(${EXE_NAME} - URI "org.easyrpg.editor" + URI "org.easyrpg.editor" VERSION 1.0 GENERATE_PLUGIN_SOURCE SOURCES @@ -428,8 +428,6 @@ ecm_target_qml_sources(${EXE_NAME} SOURCES ${EDITOR_QML_UI} ) -#ecm_find_qmlmodule(org.kde.kirigami 6.20 REQUIRED) - # liblcf option(EDITOR_BUILD_LIBLCF "Instead of detecting liblcf the liblcf repository is cloned into lib/liblcf and built together with the Player. This is convenient for development" OFF) set(EDITOR_BUILD_LIBLCF_GIT "https://github.com/EasyRPG/liblcf.git" CACHE STRING "Git repository of liblcf to clone when building liblcf. Requires EDITOR_BUILD_LIBLCF=ON.") @@ -471,8 +469,6 @@ target_link_libraries(${EXE_NAME} PRIVATE Qt6::Multimedia Qt6::Svg Qt6::QuickControls2 - KF6::Kirigami - KF6::KirigamiPlatform ) # Add resources @@ -499,14 +495,21 @@ else() message(STATUS "Disabling translation support") endif() +# Kirigami QML import path to make developing easier when using vcpkg +if (DEFINED VCPKG_TARGET_TRIPLET) + target_compile_options(${EXE_NAME} PUBLIC "-DQML_EXTRA_IMPORT_PATHS=\"${VCPKG_DIR}/lib/qml\"") +endif() + qt_finalize_target(${EXE_NAME}) # Installation include(GNUInstallDirs) if(APPLE) - set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}) - install(TARGETS ${EXE_NAME} RUNTIME DESTINATION BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/Package") + install(TARGETS ${EXE_NAME} + BUNDLE DESTINATION . + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) else() install(TARGETS ${EXE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -532,11 +535,10 @@ endif() # Generate a deployment script to be executed at install time if(WIN32 OR APPLE) # The script fails on Linux currently - # Untested on macOS + # On macOS the generated app does not run due to unsigned plugins qt_generate_deploy_qml_app_script( TARGET ${EXE_NAME} OUTPUT_SCRIPT deploy_script - MACOS_BUNDLE_POST_BUILD ) install(SCRIPT ${deploy_script}) endif() @@ -555,8 +557,8 @@ if(WIN32) # Environment for the MSVC Debugger set_target_properties(${EXE_NAME} PROPERTIES VS_DEBUGGER_ENVIRONMENT - "PATH=${VCPKG_DIR}/bin;$ENV{Qt6_Path}/bin;%PATH%\nQML2_IMPORT_PATH=${VCPKG_DIR}/lib/qml" - ) + "PATH=${VCPKG_DIR}/bin;$ENV{Qt6_Path}/bin;%PATH%" + ) # Other dev environments configure_file("cmake/setup_env.cmd.in" "setup_env.cmd") diff --git a/CMakePresets.json b/CMakePresets.json index 2f1992db..fecff825 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -129,7 +129,7 @@ { "name": "windows-parent", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-shared-easyrpgeditor" }, "inherits": "win-user", "hidden": true @@ -140,7 +140,8 @@ "inherits": [ "windows-parent", "type-debug" - ] + ], + "binaryDir": "${sourceDir}/build/win-debug" }, { "name": "windows-relwithdebinfo", @@ -148,7 +149,8 @@ "inherits": [ "windows-parent", "type-relwithdebinfo" - ] + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" }, { "name": "windows-release", @@ -156,7 +158,8 @@ "inherits": [ "windows-parent", "type-release" - ] + ], + "binaryDir": "${sourceDir}/build/win-release" }, { "name": "windows-liblcf-debug", @@ -165,7 +168,8 @@ "build-liblcf", "windows-parent", "type-debug" - ] + ], + "binaryDir": "${sourceDir}/build/win-debug" }, { "name": "windows-liblcf-relwithdebinfo", @@ -174,7 +178,8 @@ "build-liblcf", "windows-parent", "type-relwithdebinfo" - ] + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" }, { "name": "windows-liblcf-release", @@ -183,14 +188,15 @@ "build-liblcf", "windows-parent", "type-release" - ] + ], + "binaryDir": "${sourceDir}/build/win-release" }, { "name": "windows-x64-vs2022-parent", "generator": "Visual Studio 17 2022", "architecture": "x64", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "x64-windows-shared-easyrpgeditor" }, "inherits": "win-user", "hidden": true @@ -201,7 +207,8 @@ "inherits": [ "windows-x64-vs2022-parent", "type-debug" - ] + ], + "binaryDir": "${sourceDir}/build/win-debug" }, { "name": "windows-x64-vs2022-relwithdebinfo", @@ -209,7 +216,8 @@ "inherits": [ "windows-x64-vs2022-parent", "type-relwithdebinfo" - ] + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" }, { "name": "windows-x64-vs2022-release", @@ -217,7 +225,8 @@ "inherits": [ "windows-x64-vs2022-parent", "type-release" - ] + ], + "binaryDir": "${sourceDir}/build/win-release" }, { "name": "windows-x64-vs2022-liblcf-debug", @@ -226,7 +235,8 @@ "build-liblcf", "windows-x64-vs2022-parent", "type-debug" - ] + ], + "binaryDir": "${sourceDir}/build/win-debug" }, { "name": "windows-x64-vs2022-liblcf-relwithdebinfo", @@ -235,7 +245,8 @@ "build-liblcf", "windows-x64-vs2022-parent", "type-relwithdebinfo" - ] + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" }, { "name": "windows-x64-vs2022-liblcf-release", @@ -244,14 +255,18 @@ "build-liblcf", "windows-x64-vs2022-parent", "type-release" - ] + ], + "binaryDir": "${sourceDir}/build/win-release" }, { "name": "macos-parent", "cacheVariables": { - "PLAYER_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/universal", - "CMAKE_OSX_DEPLOYMENT_TARGET": "10.9", - "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64" + "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", + "CMAKE_OSX_ARCHITECTURES": "arm64" + }, + "environment": { + "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos" }, "condition": { "type": "equals", diff --git a/builds/vcpkg_overlay/kddockwidgets/portfile.cmake b/builds/vcpkg_overlay/kddockwidgets/portfile.cmake index ce241e0e..b259123f 100644 --- a/builds/vcpkg_overlay/kddockwidgets/portfile.cmake +++ b/builds/vcpkg_overlay/kddockwidgets/portfile.cmake @@ -46,7 +46,7 @@ vcpkg_cmake_configure( -DCMAKE_DISABLE_FIND_PACKAGE_spdlog=ON -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON -DCMAKE_REQUIRE_FIND_PACKAGE_nlohmann_json=ON - -DCMAKE_PREFIX_PATH="$ENV{Qt6_Path}" + "-DCMAKE_PREFIX_PATH=$ENV{Qt6_Path}" ) vcpkg_cmake_install() diff --git a/builds/vcpkg_overlay/kirigami/portfile.cmake b/builds/vcpkg_overlay/kirigami/portfile.cmake index d44b3fbc..ea0309d9 100644 --- a/builds/vcpkg_overlay/kirigami/portfile.cmake +++ b/builds/vcpkg_overlay/kirigami/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KDE/kirigami @@ -6,6 +8,8 @@ vcpkg_from_github( HEAD_REF master ) +vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt" "configure_file(qmllint.ini.in" "#configure_file(qmllint.ini.in") + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS diff --git a/cmake/CMakePresets.json.template b/cmake/CMakePresets.json.template index 5d1c9b03..34fa210f 100644 --- a/cmake/CMakePresets.json.template +++ b/cmake/CMakePresets.json.template @@ -38,9 +38,12 @@ "name": "macos", "displayName": "macOS", "cacheVariables": { - "PLAYER_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/universal", - "CMAKE_OSX_DEPLOYMENT_TARGET": "10.9", - "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64" + "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", + "CMAKE_OSX_ARCHITECTURES": "arm64" + }, + "environment": { + "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos" }, "condition": { "type": "equals", diff --git a/src/main.cpp b/src/main.cpp index c8e49292..9d84d270 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,8 +23,7 @@ #include #include -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { QApplication a(argc, argv); // show splash @@ -43,6 +42,9 @@ int main(int argc, char *argv[]) // setup qml engine QQmlApplicationEngine engine; +#ifdef QML_EXTRA_IMPORT_PATHS + engine.addImportPath(QML_EXTRA_IMPORT_PATHS); +#endif engine.loadFromModule("org.easyrpg.editor", "MainWindow"); if (engine.rootObjects().isEmpty()) { diff --git a/vcpkg.json b/vcpkg.json index c7657902..3d756da0 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,8 +8,8 @@ "features": ["cpp"] }, "ecm", - "expat", - "glaze", + "expat", + "glaze", "kddockwidgets", "kirigami" ] From af1aa845f6ac4cf3d3ded1b126767d4d17b5dc5a Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 20 Feb 2026 15:47:51 +0100 Subject: [PATCH 14/21] Fix error in the MainWindow.qml stub --- src/ui/MainWindow.qml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ui/MainWindow.qml b/src/ui/MainWindow.qml index 8dcfcfa8..0d513b25 100644 --- a/src/ui/MainWindow.qml +++ b/src/ui/MainWindow.qml @@ -6,16 +6,13 @@ import org.kde.kirigami as Kirigami import org.easyrpg.editor as EasyRPG Kirigami.ApplicationWindow { - id: root + id: root - width: 1024 - height: 600 + width: 1024 + height: 600 - title: "Hello World" + title: "Hello World" pageStack { - initialPage: pageRoot - columnView.interactive: true - //columnView.interactiveResizeEnabled: true } } From 85b6eac4242825c7122c6c353f00b40eacf90d67 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 20 Feb 2026 16:06:06 +0100 Subject: [PATCH 15/21] Windows: Back to static preset, figured it out --- CMakePresets.json | 4 ++-- cmake/CMakePresets.json.template | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index fecff825..cf9452e4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -129,7 +129,7 @@ { "name": "windows-parent", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-shared-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" }, "inherits": "win-user", "hidden": true @@ -196,7 +196,7 @@ "generator": "Visual Studio 17 2022", "architecture": "x64", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-shared-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" }, "inherits": "win-user", "hidden": true diff --git a/cmake/CMakePresets.json.template b/cmake/CMakePresets.json.template index 34fa210f..5012a5c1 100644 --- a/cmake/CMakePresets.json.template +++ b/cmake/CMakePresets.json.template @@ -18,7 +18,7 @@ "name": "windows", "displayName": "Windows", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-shared-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" }, "inherits": "win-user", "easyrpg_platforms": ["liblcf"] @@ -29,7 +29,7 @@ "generator": "Visual Studio 17 2022", "architecture": "x64", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-shared-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" }, "inherits": "win-user", "easyrpg_platforms": ["liblcf"] From 435c50ba6e3ca885ba2e0efdef9f6978527d6412 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 20 Feb 2026 17:15:08 +0100 Subject: [PATCH 16/21] Update flatpak --- .gitignore | 1 + builds/flatpak/org.easyrpg.editor.yml | 51 +++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 83958be5..4dfa5105 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ Makefile* # flatpak /.flatpak-builder +/local-repo # liblcf lib/liblcf diff --git a/builds/flatpak/org.easyrpg.editor.yml b/builds/flatpak/org.easyrpg.editor.yml index 371c897a..8c761599 100644 --- a/builds/flatpak/org.easyrpg.editor.yml +++ b/builds/flatpak/org.easyrpg.editor.yml @@ -1,6 +1,6 @@ app-id: org.easyrpg.editor runtime: org.kde.Sdk -runtime-version: '5.15-21.08' +runtime-version: '6.10' sdk: org.kde.Sdk command: easyrpg-editor rename-desktop-file: easyrpg-editor.desktop @@ -33,6 +33,53 @@ modules: url: https://github.com/benhoyt/inih.git tag: 58 commit: 5cc5e2c24642513aaa5b19126aad42d0e4e0923e + - name: libexpat + buildsystem: cmake-ninja + builddir: true + subdir: expat + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + - -DEXPAT_BUILD_TOOLS=OFF + - -DEXPAT_BUILD_EXAMPLES=OFF + - -DEXPAT_BUILD_TESTS=OFF + - -DEXPAT_BUILD_DOCS=OFF + sources: + - type: url + url: https://github.com/libexpat/libexpat.git + branch: R_2_7_4 + cleanup: + - /share + - name: glaze + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + - -Dglaze_DEVELOPER_MODE=OFF + - -Dglaze_BUILD_EXAMPLES=OFF + sources: + - type: git + url: https://github.com/stephenberry/glaze.git + branch: v7.0.2 + cleanup: + - /share + - name: kddockwidgets + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DKDDockWidgets_QT6=ON + - -DKDDockWidgets_FRONTENDS=qtquick + - -DKDDockWidgets_PYTHON_BINDINGS=OFF + - -DKDDockWidgets_TESTS=OFF + - -DKDDockWidgets_EXAMPLES=OFF + - -DCMAKE_DISABLE_FIND_PACKAGE_spdlog=ON + - -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON + - -DCMAKE_DISABLE_FIND_PACKAGE_nlohmann_json=ON + sources: + - type: git + url: https://github.com/KDAB/KDDockWidgets.git + branch: v2.4.0 + cleanup: + - /share # own libraries - name: liblcf buildsystem: cmake-ninja @@ -40,7 +87,6 @@ modules: config-opts: - -DCMAKE_BUILD_TYPE=RelWithDebInfo - -DLIBLCF_ENABLE_TOOLS=OFF - - -DLIBLCF_WITH_XML=OFF - -DLIBLCF_ENABLE_TESTS=OFF - -DLIBLCF_UPDATE_MIMEDB=OFF sources: @@ -55,3 +101,4 @@ modules: sources: - type: git url: https://github.com/EasyRPG/Editor.git + branch: master From c1ccdeea37adecd31a55a315b0c5595451c1a064 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 20 Feb 2026 17:15:18 +0100 Subject: [PATCH 17/21] Remove outdated README file in bin --- bin/README | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 bin/README diff --git a/bin/README b/bin/README deleted file mode 100644 index 02516286..00000000 --- a/bin/README +++ /dev/null @@ -1,15 +0,0 @@ -This application needs the following shared libraries -to work in windows platform: - -icudt51.dll -icuin51.dll -icuuc51.dll -libEGL.dll -libGLESv2.dll -Qt5Core.dll -Qt5Gui.dll -Qt5Multimedia.dll -Qt5Network.dll -Qt5Widgets.dll -Qt5WinExtras.dll -platforms/qwindows.dll \ No newline at end of file From 947840ef3b6cfc5e64171a56b00e35b59733a33a Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 20 Feb 2026 17:18:25 +0100 Subject: [PATCH 18/21] CMake: Relocate into builds subdirectory (matches Player structure) --- .gitignore | 1 - CMakeLists.txt | 4 +- CMakePresets.json | 2 +- builds/CMakePresets.json | 532 ++++++++++++++++++ .../cmake}/CMakePresets.json.template | 2 +- {cmake => builds/cmake}/CMakePresetsBase.json | 0 {cmake => builds/cmake}/CMakePresetsUser.json | 0 .../Modules/EditorConfigureWindows.cmake | 0 {cmake => builds/cmake}/gen-cmake-presets.py | 0 {cmake => builds/cmake}/setup_env.cmd.in | 0 10 files changed, 536 insertions(+), 5 deletions(-) create mode 100644 builds/CMakePresets.json rename {cmake => builds/cmake}/CMakePresets.json.template (97%) rename {cmake => builds/cmake}/CMakePresetsBase.json (100%) rename {cmake => builds/cmake}/CMakePresetsUser.json (100%) rename {cmake => builds/cmake}/Modules/EditorConfigureWindows.cmake (100%) rename {cmake => builds/cmake}/gen-cmake-presets.py (100%) rename {cmake => builds/cmake}/setup_env.cmd.in (100%) diff --git a/.gitignore b/.gitignore index 4dfa5105..a10c1e96 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,6 @@ CMakeCache.txt CMakeFiles/ cmake_install.cmake *automoc.cpp -.cmake/ cmake-build-*/ build/ install/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 17ddd8c3..cea25999 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set(KF_DEP_VERSION "6.11.0") # Extra CMake Module files find_package(ECM ${KF_DEP_VERSION} REQUIRED) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ${ECM_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/Modules" ${ECM_MODULE_PATH}) include(EditorConfigureWindows) # Dependencies provided by CMake Presets @@ -561,6 +561,6 @@ if(WIN32) ) # Other dev environments - configure_file("cmake/setup_env.cmd.in" "setup_env.cmd") + configure_file("builds/cmake/setup_env.cmd.in" "setup_env.cmd") message(STATUS "When not using Visual Studio for development run setup_env.cmd to configure the environment") endif() diff --git a/CMakePresets.json b/CMakePresets.json index cf9452e4..4c18309c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,7 +13,7 @@ "patch": 0 }, "include": [ - "cmake/CMakePresetsUser.json" + "builds/cmake/CMakePresetsUser.json" ], "configurePresets": [ { diff --git a/builds/CMakePresets.json b/builds/CMakePresets.json new file mode 100644 index 00000000..4c18309c --- /dev/null +++ b/builds/CMakePresets.json @@ -0,0 +1,532 @@ +{ + "vendor": { + "README": { + "line1": "!!! GENERATED FILE. DO NOT EDIT !!!", + "line2": "Modify builds/cmake/CMakePresets.json.template instead", + "line3": "and run gen-cmake-presets.py to regenerate this file." + } + }, + "version": 4, + "cmakeMinimumRequired": { + "major": 3, + "minor": 23, + "patch": 0 + }, + "include": [ + "builds/cmake/CMakePresetsUser.json" + ], + "configurePresets": [ + { + "name": "parent", + "hidden": true, + "inherits": "base-user" + }, + { + "name": "debug", + "displayName": "System environment (Debug)", + "inherits": [ + "parent", + "type-debug" + ] + }, + { + "name": "relwithdebinfo", + "displayName": "System environment (RelWithDebInfo)", + "inherits": [ + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "release", + "displayName": "System environment (Release)", + "inherits": [ + "parent", + "type-release" + ] + }, + { + "name": "liblcf-debug", + "displayName": "System environment (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "parent", + "type-debug" + ] + }, + { + "name": "liblcf-relwithdebinfo", + "displayName": "System environment (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "liblcf-release", + "displayName": "System environment (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "parent", + "type-release" + ] + }, + { + "name": "vcpkg-debug", + "displayName": "System environment (install deps with vcpkg, Debug)", + "inherits": [ + "build-vcpkg", + "parent", + "type-debug" + ] + }, + { + "name": "vcpkg-relwithdebinfo", + "displayName": "System environment (install deps with vcpkg, RelWithDebInfo)", + "inherits": [ + "build-vcpkg", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "vcpkg-release", + "displayName": "System environment (install deps with vcpkg, Release)", + "inherits": [ + "build-vcpkg", + "parent", + "type-release" + ] + }, + { + "name": "vcpkg-liblcf-debug", + "displayName": "System environment (install deps with vcpkg + build liblcf, Debug)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-debug" + ] + }, + { + "name": "vcpkg-liblcf-relwithdebinfo", + "displayName": "System environment (install deps with vcpkg + build liblcf, RelWithDebInfo)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "vcpkg-liblcf-release", + "displayName": "System environment (install deps with vcpkg + build liblcf, Release)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-release" + ] + }, + { + "name": "windows-parent", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "hidden": true + }, + { + "name": "windows-debug", + "displayName": "Windows (Debug)", + "inherits": [ + "windows-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-relwithdebinfo", + "displayName": "Windows (RelWithDebInfo)", + "inherits": [ + "windows-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-release", + "displayName": "Windows (Release)", + "inherits": [ + "windows-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-liblcf-debug", + "displayName": "Windows (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-liblcf-relwithdebinfo", + "displayName": "Windows (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-liblcf-release", + "displayName": "Windows (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-x64-vs2022-parent", + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "hidden": true + }, + { + "name": "windows-x64-vs2022-debug", + "displayName": "Windows (x64) using Visual Studio 2022 (Debug)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-x64-vs2022-relwithdebinfo", + "displayName": "Windows (x64) using Visual Studio 2022 (RelWithDebInfo)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-release", + "displayName": "Windows (x64) using Visual Studio 2022 (Release)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-x64-vs2022-liblcf-debug", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-x64-vs2022-liblcf-relwithdebinfo", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-liblcf-release", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "macos-parent", + "cacheVariables": { + "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", + "CMAKE_OSX_ARCHITECTURES": "arm64" + }, + "environment": { + "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "hidden": true, + "inherits": "base-user" + }, + { + "name": "macos-debug", + "displayName": "macOS (Debug)", + "inherits": [ + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-relwithdebinfo", + "displayName": "macOS (RelWithDebInfo)", + "inherits": [ + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-release", + "displayName": "macOS (Release)", + "inherits": [ + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-liblcf-debug", + "displayName": "macOS (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-liblcf-relwithdebinfo", + "displayName": "macOS (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-liblcf-release", + "displayName": "macOS (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-vcpkg-debug", + "displayName": "macOS (install deps with vcpkg, Debug)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-vcpkg-relwithdebinfo", + "displayName": "macOS (install deps with vcpkg, RelWithDebInfo)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-vcpkg-release", + "displayName": "macOS (install deps with vcpkg, Release)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-vcpkg-liblcf-debug", + "displayName": "macOS (install deps with vcpkg + build liblcf, Debug)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-vcpkg-liblcf-relwithdebinfo", + "displayName": "macOS (install deps with vcpkg + build liblcf, RelWithDebInfo)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-vcpkg-liblcf-release", + "displayName": "macOS (install deps with vcpkg + build liblcf, Release)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-release" + ] + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "debug" + }, + { + "name": "relwithdebinfo", + "configurePreset": "relwithdebinfo" + }, + { + "name": "release", + "configurePreset": "release" + }, + { + "name": "liblcf-debug", + "configurePreset": "liblcf-debug" + }, + { + "name": "liblcf-relwithdebinfo", + "configurePreset": "liblcf-relwithdebinfo" + }, + { + "name": "liblcf-release", + "configurePreset": "liblcf-release" + }, + { + "name": "vcpkg-debug", + "configurePreset": "vcpkg-debug" + }, + { + "name": "vcpkg-relwithdebinfo", + "configurePreset": "vcpkg-relwithdebinfo" + }, + { + "name": "vcpkg-release", + "configurePreset": "vcpkg-release" + }, + { + "name": "vcpkg-liblcf-debug", + "configurePreset": "vcpkg-liblcf-debug" + }, + { + "name": "vcpkg-liblcf-relwithdebinfo", + "configurePreset": "vcpkg-liblcf-relwithdebinfo" + }, + { + "name": "vcpkg-liblcf-release", + "configurePreset": "vcpkg-liblcf-release" + }, + { + "name": "windows-debug", + "configurePreset": "windows-debug" + }, + { + "name": "windows-relwithdebinfo", + "configurePreset": "windows-relwithdebinfo" + }, + { + "name": "windows-release", + "configurePreset": "windows-release" + }, + { + "name": "windows-liblcf-debug", + "configurePreset": "windows-liblcf-debug" + }, + { + "name": "windows-liblcf-relwithdebinfo", + "configurePreset": "windows-liblcf-relwithdebinfo" + }, + { + "name": "windows-liblcf-release", + "configurePreset": "windows-liblcf-release" + }, + { + "name": "windows-x64-vs2022-debug", + "configurePreset": "windows-x64-vs2022-debug" + }, + { + "name": "windows-x64-vs2022-relwithdebinfo", + "configurePreset": "windows-x64-vs2022-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-release", + "configurePreset": "windows-x64-vs2022-release" + }, + { + "name": "windows-x64-vs2022-liblcf-debug", + "configurePreset": "windows-x64-vs2022-liblcf-debug" + }, + { + "name": "windows-x64-vs2022-liblcf-relwithdebinfo", + "configurePreset": "windows-x64-vs2022-liblcf-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-liblcf-release", + "configurePreset": "windows-x64-vs2022-liblcf-release" + }, + { + "name": "macos-debug", + "configurePreset": "macos-debug" + }, + { + "name": "macos-relwithdebinfo", + "configurePreset": "macos-relwithdebinfo" + }, + { + "name": "macos-release", + "configurePreset": "macos-release" + }, + { + "name": "macos-liblcf-debug", + "configurePreset": "macos-liblcf-debug" + }, + { + "name": "macos-liblcf-relwithdebinfo", + "configurePreset": "macos-liblcf-relwithdebinfo" + }, + { + "name": "macos-liblcf-release", + "configurePreset": "macos-liblcf-release" + }, + { + "name": "macos-vcpkg-debug", + "configurePreset": "macos-vcpkg-debug" + }, + { + "name": "macos-vcpkg-relwithdebinfo", + "configurePreset": "macos-vcpkg-relwithdebinfo" + }, + { + "name": "macos-vcpkg-release", + "configurePreset": "macos-vcpkg-release" + }, + { + "name": "macos-vcpkg-liblcf-debug", + "configurePreset": "macos-vcpkg-liblcf-debug" + }, + { + "name": "macos-vcpkg-liblcf-relwithdebinfo", + "configurePreset": "macos-vcpkg-liblcf-relwithdebinfo" + }, + { + "name": "macos-vcpkg-liblcf-release", + "configurePreset": "macos-vcpkg-liblcf-release" + } + ], + "testPresets": [] +} diff --git a/cmake/CMakePresets.json.template b/builds/cmake/CMakePresets.json.template similarity index 97% rename from cmake/CMakePresets.json.template rename to builds/cmake/CMakePresets.json.template index 5012a5c1..348b0f49 100644 --- a/cmake/CMakePresets.json.template +++ b/builds/cmake/CMakePresets.json.template @@ -6,7 +6,7 @@ "patch": 0 }, "include": [ - "cmake/CMakePresetsUser.json" + "builds/cmake/CMakePresetsUser.json" ], "configurePresets": [ { diff --git a/cmake/CMakePresetsBase.json b/builds/cmake/CMakePresetsBase.json similarity index 100% rename from cmake/CMakePresetsBase.json rename to builds/cmake/CMakePresetsBase.json diff --git a/cmake/CMakePresetsUser.json b/builds/cmake/CMakePresetsUser.json similarity index 100% rename from cmake/CMakePresetsUser.json rename to builds/cmake/CMakePresetsUser.json diff --git a/cmake/Modules/EditorConfigureWindows.cmake b/builds/cmake/Modules/EditorConfigureWindows.cmake similarity index 100% rename from cmake/Modules/EditorConfigureWindows.cmake rename to builds/cmake/Modules/EditorConfigureWindows.cmake diff --git a/cmake/gen-cmake-presets.py b/builds/cmake/gen-cmake-presets.py similarity index 100% rename from cmake/gen-cmake-presets.py rename to builds/cmake/gen-cmake-presets.py diff --git a/cmake/setup_env.cmd.in b/builds/cmake/setup_env.cmd.in similarity index 100% rename from cmake/setup_env.cmd.in rename to builds/cmake/setup_env.cmd.in From fc57990f087e0acddf485ca4208507bb42b55e1c Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 20 Feb 2026 19:18:16 +0100 Subject: [PATCH 19/21] Add Linux GitHub workflows Only Flatpak and the latest ubuntu as I'm already cheating by downloading a newer Qt6 version liblcf ICU support is disabled due to the buildsystem picking the ICU components from Qt6 which causes linker errors. --- .github/workflows/ci.yml | 47 ++++++++++++++++++--------- builds/flatpak/org.easyrpg.editor.yml | 5 ++- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 400f0015..11829f25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,19 +18,19 @@ jobs: name: "Flatpak" runs-on: ubuntu-latest container: - image: bilelmoussaoui/flatpak-github-actions:kde-5.15-21.08 + image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.10 options: --privileged steps: - - uses: actions/checkout@v2 - - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + - uses: actions/checkout@v4 + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 with: bundle: EasyRPG-Editor.flatpak manifest-path: builds/flatpak/org.easyrpg.editor.yml cache-key: flatpak-builder-${{ github.sha }} docker: - name: ${{ matrix.image }} - runs-on: ubuntu-latest + name: ${{ matrix.image }} (${{ matrix.os.arch }}) + runs-on: ${{ matrix.os.name }} container: image: ${{ matrix.image }} @@ -38,10 +38,14 @@ jobs: fail-fast: false matrix: image: - - ubuntu:20.04 # LTS | CMake 3.16.3 | G++ 9.3.0 | QT 5.12.8 - - ubuntu:22.04 # LTS | CMake 3.22.1 | G++ 11.2.0 | QT 5.15.3 - - debian:12 # stable | CMake 3.25.1 | G++ 12.2.0 | QT 5.15.8 - - ubuntu:24.04 # LTS | CMake 3.28.3 | G++ 13.2.0 | QT 5.15.13 + # version of: # CMake | g++ | Qt | support end # + # ------------------------------------------------------------- + - ubuntu:24.04 # 3.28.3 | 13.2.0 | (too old) | LTS (4/29) # + os: + - arch: x86_64 + name: ubuntu-latest + - arch: arm64 + name: ubuntu-24.04-arm steps: - name: Cancel Previous Runs @@ -53,8 +57,18 @@ jobs: apt-get update apt-get install -yqq --no-install-recommends --no-install-suggests \ ca-certificates build-essential cmake ninja-build git \ - libicu-dev libexpat1-dev libinih-dev qttools5-dev-tools \ - qtbase5-dev-tools qtbase5-dev qtmultimedia5-dev libqt5svg5-dev + curl zip unzip tar tzdata + + - name: Install Qt6 + uses: jurplel/install-qt-action@v4 + with: + version: '6.10.1' + install-deps: 'nosudo' + modules: 'qtmultimedia qtshadertools' + + - name: Install vcpkg + run: | + git clone https://github.com/Microsoft/vcpkg.git ../vcpkg - name: Clone Repository uses: actions/checkout@v2 @@ -67,11 +81,12 @@ jobs: - name: Compile run: | - cmake -G Ninja . -B build-ga \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \ - -DEDITOR_BUILD_LIBLCF=ON - cmake --build build-ga + export VCPKG_ROOT=$PWD/../vcpkg + export Qt6_Path=$QT_ROOT_DIR + cmake --preset vcpkg-liblcf-release -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_PREFIX_PATH=$QT_ROOT_DIR -DLIBLCF_WITH_ICU=OFF + cmake --build --preset vcpkg-liblcf-release - name: Install run: | - cmake --install build-ga + cmake --build --preset vcpkg-liblcf-release --target install diff --git a/builds/flatpak/org.easyrpg.editor.yml b/builds/flatpak/org.easyrpg.editor.yml index 8c761599..b7bb9cae 100644 --- a/builds/flatpak/org.easyrpg.editor.yml +++ b/builds/flatpak/org.easyrpg.editor.yml @@ -99,6 +99,5 @@ modules: config-opts: - -DCMAKE_BUILD_TYPE=RelWithDebInfo sources: - - type: git - url: https://github.com/EasyRPG/Editor.git - branch: master + - type: dir + path: "../../" From 2078439e6ecc94bbf3a89138f234b8aa8316ccb0 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Mon, 23 Feb 2026 17:44:27 +0100 Subject: [PATCH 20/21] Infrastructure (dependabot and comment matcher) --- .github/dependabot.yml | 12 ++++++++++++ .github/gcc_comment_matcher.json | 17 +++++++++++++++++ .../{ci.yml => stable-compilation.yml} | 3 +++ 3 files changed, 32 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/gcc_comment_matcher.json rename .github/workflows/{ci.yml => stable-compilation.yml} (96%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..202e28ba --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: monthly + labels: + - "Building" + #reviewers: + # - carstene1ns + commit-message: + prefix: "CI" diff --git a/.github/gcc_comment_matcher.json b/.github/gcc_comment_matcher.json new file mode 100644 index 00000000..81995b45 --- /dev/null +++ b/.github/gcc_comment_matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "gcc-problem-matcher", + "pattern": [ + { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/stable-compilation.yml similarity index 96% rename from .github/workflows/ci.yml rename to .github/workflows/stable-compilation.yml index 11829f25..b7333404 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/stable-compilation.yml @@ -79,6 +79,9 @@ jobs: with: ref: ${{ github.event.inputs.git-ref }} + - name: Use gcc problem matcher + run: echo "::add-matcher::.github/gcc_comment_matcher.json" + - name: Compile run: | export VCPKG_ROOT=$PWD/../vcpkg From 57c99f6dba8d7f9e15ad3723c1068cbacf2a5a6d Mon Sep 17 00:00:00 2001 From: Ghabry Date: Mon, 23 Feb 2026 17:44:55 +0100 Subject: [PATCH 21/21] Remove Player leftover, set title window --- builds/cmake/gen-cmake-presets.py | 4 ---- src/ui/MainWindow.qml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/builds/cmake/gen-cmake-presets.py b/builds/cmake/gen-cmake-presets.py index c8206dd2..21e2faa9 100644 --- a/builds/cmake/gen-cmake-presets.py +++ b/builds/cmake/gen-cmake-presets.py @@ -24,10 +24,6 @@ def append_name(name): item["name"] += name platform_display = dict( - sdl1="SDL1", - sdl2="SDL2", - sdl3="SDL3", - libretro="libretro core", liblcf="build liblcf", vcpkg="install deps with vcpkg" ) diff --git a/src/ui/MainWindow.qml b/src/ui/MainWindow.qml index 0d513b25..a60d966e 100644 --- a/src/ui/MainWindow.qml +++ b/src/ui/MainWindow.qml @@ -11,7 +11,7 @@ Kirigami.ApplicationWindow { width: 1024 height: 600 - title: "Hello World" + title: "EasyRPG Editor" pageStack { }