From f7def0d883fa5cab62ef61b40b9f857245be8e6c Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 26 Nov 2023 21:29:16 -0500 Subject: Initial Qt 6 port. Many bug fixes. --- CMakeLists.txt | 32 ++++++++++---- mpris-plugin/CMakeLists.txt | 8 ++-- mpris-plugin/qmpmprisimpl.cpp | 1 - qmidiplayer-desktop/CMakeLists.txt | 7 +++- qmidiplayer-desktop/qmpchannelswindow.cpp | 14 ++----- qmidiplayer-desktop/qmpefxwindow.cpp | 56 ++++--------------------- qmidiplayer-desktop/qmpefxwindow.hpp | 10 +---- qmidiplayer-desktop/qmpinfowindow.cpp | 13 +----- qmidiplayer-desktop/qmpmainwindow.cpp | 65 +++++++++++++++++++++++------ qmidiplayer-desktop/qmpmainwindow.hpp | 3 ++ qmidiplayer-desktop/qmpsettings.cpp | 2 + simple-visualization/CMakeLists.txt | 2 +- visualization/renderer/CMakeLists.txt | 4 +- visualization/renderer/qmppluginapistub.cpp | 30 +++++++------ windows-extra/CMakeLists.txt | 4 +- 15 files changed, 125 insertions(+), 126 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c84653..3e64f6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,24 +4,36 @@ project(QMidiPlayer VERSION 0.8.7 LANGUAGES C CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -include(FindPkgConfig) -find_package(Qt5 REQUIRED COMPONENTS Widgets LinguistTools) -find_package(Threads REQUIRED) -pkg_search_module(fluidsynth REQUIRED fluidsynth>=2.0.0) -pkg_search_module(rtmidi REQUIRED rtmidi) +set(OPTIONAL_QT_DEPS "") option(BUILD_VISUALIZATION "Build visualization plugin" ON) if(WIN32) + set(OPTIONAL_QT_DEPS "WinExtras") option(BUILD_WINEXTRA "Build Windows extra library" ON) option(BUILD_BACKTRACE "Build backtrace library" OFF) endif() if(UNIX) - option(BUILD_PORTABLE "Instruct the built binary not to search system directories" OFF) + option(BUILD_PORTABLE "Instruct the built binary not to search system directories" OFF) +endif() + +option(USE_QT6 "Build with Qt 6" OFF) + +include(FindPkgConfig) +if (USE_QT6) + find_package(QT NAMES Qt6 REQUIRED) + find_package(Qt6 REQUIRED COMPONENTS Widgets LinguistTools OPTIONAL_COMPONENTS DBus ${OPTIONAL_QT_DEPS}) +else() + find_package(QT NAMES Qt5 REQUIRED) + find_package(Qt5 5.15 REQUIRED COMPONENTS Widgets LinguistTools OPTIONAL_COMPONENTS DBus ${OPTIONAL_QT_DEPS}) endif() +find_package(Threads REQUIRED) +find_package(ICU COMPONENTS uc i18n REQUIRED) +pkg_search_module(fluidsynth REQUIRED fluidsynth>=2.0.0) +pkg_search_module(rtmidi REQUIRED rtmidi) add_definitions(-DAPP_VERSION=\"${PROJECT_VERSION}\") add_definitions(-DPLUGIN_VERSION=\"${PROJECT_VERSION}\") @@ -32,14 +44,16 @@ add_definitions(-DRC_VER_PATCH=${PROJECT_VERSION_PATCH}) add_subdirectory(core) add_subdirectory(qmidiplayer-desktop) add_subdirectory(sample-plugin) -add_subdirectory(mpris-plugin) +if (Qt${QT_VERSION_MAJOR}DBus_FOUND) + add_subdirectory(mpris-plugin) +endif() add_subdirectory(midifmt-plugin) add_subdirectory(simple-visualization) if(BUILD_VISUALIZATION) add_subdirectory(visualization) endif() if(WIN32) - if(BUILD_WINEXTRA) + if(BUILD_WINEXTRA AND Qt${QT_VERSION_MAJOR}WinExtras_FOUND) add_subdirectory(windows-extra) endif() if(BUILD_BACKTRACE) diff --git a/mpris-plugin/CMakeLists.txt b/mpris-plugin/CMakeLists.txt index c0395c0..1366f39 100644 --- a/mpris-plugin/CMakeLists.txt +++ b/mpris-plugin/CMakeLists.txt @@ -13,8 +13,6 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt5 REQUIRED COMPONENTS DBus) - include_directories(${PROJECT_SOURCE_DIR}/include/) add_library(qmpmpris MODULE @@ -22,9 +20,9 @@ add_library(qmpmpris MODULE ) target_link_libraries(qmpmpris - Qt5::Core - Qt5::Widgets - Qt5::DBus + Qt${QT_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::Widgets + Qt${QT_VERSION_MAJOR}::DBus ) install(TARGETS qmpmpris LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/qmidiplayer/) diff --git a/mpris-plugin/qmpmprisimpl.cpp b/mpris-plugin/qmpmprisimpl.cpp index 335a638..583cc70 100644 --- a/mpris-plugin/qmpmprisimpl.cpp +++ b/mpris-plugin/qmpmprisimpl.cpp @@ -56,7 +56,6 @@ QVariantMap QMPPlayer::getMetadata() qlonglong QMPPlayer::getPosition() { ::PlaybackStatus ps = api->getPlaybackStatus(); - fprintf(stderr, "%lu\n", ps.curtime_ms); return ps.curtime_ms * 1000; } diff --git a/qmidiplayer-desktop/CMakeLists.txt b/qmidiplayer-desktop/CMakeLists.txt index d3ee116..5def90f 100644 --- a/qmidiplayer-desktop/CMakeLists.txt +++ b/qmidiplayer-desktop/CMakeLists.txt @@ -57,6 +57,7 @@ set(CMAKE_AUTOUIC ON) include_directories(${fluidsynth_INCLUDE_DIRS}) include_directories(${rtmidi_INCLUDE_DIRS}) +include_directories(${ICU_INCLUDE_DIR}) include_directories(${PROJECT_SOURCE_DIR}/include/) include_directories(${PROJECT_SOURCE_DIR}/core/) @@ -71,8 +72,10 @@ add_executable(qmidiplayer ) target_link_libraries(qmidiplayer - Qt5::Widgets + Qt${QT_VERSION_MAJOR}::Widgets qmpcore + ICU::uc + ICU::i18n ${fluidsynth_LIBRARIES} ${rtmidi_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} @@ -90,7 +93,7 @@ PRIVATE ) file(GLOB qmpdesktop_TS_FILES translations/*.ts) -qt5_create_translation(qmpdesktop_QM_FILES ${qmpdesktop_SOURCES} ${qmpdesktop_TS_FILES}) +qt_create_translation(qmpdesktop_QM_FILES ${qmpdesktop_SOURCES} ${qmpdesktop_TS_FILES}) add_custom_target(translations ALL DEPENDS ${qmpdesktop_QM_FILES}) install(TARGETS qmidiplayer) diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp index 8957254..7743084 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.cpp +++ b/qmidiplayer-desktop/qmpchannelswindow.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -14,23 +13,16 @@ qmpChannelsModel::qmpChannelsModel(QObject *parent): QAbstractTableModel(parent) evh = qmpMainWindow::getInstance()->getPlayer()->registerEventHandler( [this](const void *_e, void *) { + const SEvent *e = (const SEvent *)(_e); + if ((e->type & 0xF0) == 0xC0) + emit dataChanged(index(e->type & 0x0F, 4), index(e->type & 0x0F, 4), {Qt::ItemDataRole::DisplayRole}); if (!updatequeued) { updatequeued = true; - const SEvent *e = (const SEvent *)(_e); - if ((e->p1 & 0xF0) == 0xC0) - emit dataChanged(index(e->p1 & 0xF0, 4), index(e->p1 & 0xF0, 4), {Qt::ItemDataRole::DisplayRole}); QMetaObject::invokeMethod(this, &qmpChannelsModel::updateChannelActivity, Qt::ConnectionType::QueuedConnection); } } , nullptr, false); - QTimer *t = new QTimer(this); - t->setInterval(500); - t->setSingleShot(false); - connect(t, &QTimer::timeout, [this]() - { - emit this->dataChanged(this->index(0, 4), this->index(15, 4), {Qt::ItemDataRole::DisplayRole}); - }); memset(mute, 0, sizeof(mute)); memset(solo, 0, sizeof(solo)); } diff --git a/qmidiplayer-desktop/qmpefxwindow.cpp b/qmidiplayer-desktop/qmpefxwindow.cpp index 0a281cd..2cea976 100644 --- a/qmidiplayer-desktop/qmpefxwindow.cpp +++ b/qmidiplayer-desktop/qmpefxwindow.cpp @@ -35,6 +35,14 @@ qmpEfxWindow::qmpEfxWindow(QWidget *parent) : 0, true ); + connect(ui->sbRoom, qOverload(&QSpinBox::valueChanged), this, &qmpEfxWindow::spinValueChange); + connect(ui->sbDamp, qOverload(&QSpinBox::valueChanged), this, &qmpEfxWindow::spinValueChange); + connect(ui->sbWidth, qOverload(&QSpinBox::valueChanged), this, &qmpEfxWindow::spinValueChange); + connect(ui->sbLevelR, qOverload(&QSpinBox::valueChanged), this, &qmpEfxWindow::spinValueChange); + connect(ui->sbFeedBack, qOverload(&QSpinBox::valueChanged), this, &qmpEfxWindow::spinValueChange); + connect(ui->sbRate, qOverload(&QDoubleSpinBox::valueChanged), this, &qmpEfxWindow::spinValueChange); + connect(ui->sbDepth, qOverload(&QDoubleSpinBox::valueChanged), this, &qmpEfxWindow::spinValueChange); + connect(ui->sbLevelC, qOverload(&QSpinBox::valueChanged), this, &qmpEfxWindow::spinValueChange); if (!settings->getOptionRaw("DialogStatus/EfxW", QRect()).toRect().isNull()) setGeometry(settings->getOptionRaw("DialogStatus/EfxW", QRect()).toRect()); if (settings->getOptionRaw("DialogStatus/EfxWShown", 0).toInt()) @@ -218,54 +226,6 @@ void qmpEfxWindow::on_dLevelC_valueChanged() dailValueChange(); } -void qmpEfxWindow::on_sbRoom_valueChanged(QString s) -{ - s = QString(); - spinValueChange(); -} - -void qmpEfxWindow::on_sbDamp_valueChanged(QString s) -{ - s = QString(); - spinValueChange(); -} - -void qmpEfxWindow::on_sbWidth_valueChanged(QString s) -{ - s = QString(); - spinValueChange(); -} - -void qmpEfxWindow::on_sbLevelR_valueChanged(QString s) -{ - s = QString(); - spinValueChange(); -} - -void qmpEfxWindow::on_sbFeedBack_valueChanged(QString s) -{ - s = QString(); - spinValueChange(); -} - -void qmpEfxWindow::on_sbRate_valueChanged(QString s) -{ - s = QString(); - spinValueChange(); -} - -void qmpEfxWindow::on_sbDepth_valueChanged(QString s) -{ - s = QString(); - spinValueChange(); -} - -void qmpEfxWindow::on_sbLevelC_valueChanged(QString s) -{ - s = QString(); - spinValueChange(); -} - void qmpEfxWindow::on_cbEnabledC_stateChanged() { sendEfxChange(); diff --git a/qmidiplayer-desktop/qmpefxwindow.hpp b/qmidiplayer-desktop/qmpefxwindow.hpp index 9e5e8bf..3b74df3 100644 --- a/qmidiplayer-desktop/qmpefxwindow.hpp +++ b/qmidiplayer-desktop/qmpefxwindow.hpp @@ -46,22 +46,14 @@ private slots: void on_dRate_valueChanged(); void on_dDepth_valueChanged(); void on_dLevelC_valueChanged(); - void on_sbRoom_valueChanged(QString s); - void on_sbDamp_valueChanged(QString s); - void on_sbWidth_valueChanged(QString s); - void on_sbLevelR_valueChanged(QString s); - void on_sbFeedBack_valueChanged(QString s); - void on_sbRate_valueChanged(QString s); - void on_sbDepth_valueChanged(QString s); - void on_sbLevelC_valueChanged(QString s); void on_cbEnabledC_stateChanged(); void on_cbEnabledR_stateChanged(); void on_rbSine_toggled(); void on_rbTriangle_toggled(); + void spinValueChange(); private: void dailValueChange(); - void spinValueChange(); Ui::qmpEfxWindow *ui; double rr, rd, rw, rl; int cfb, ct, initialized; diff --git a/qmidiplayer-desktop/qmpinfowindow.cpp b/qmidiplayer-desktop/qmpinfowindow.cpp index 654c8f4..fe46c18 100644 --- a/qmidiplayer-desktop/qmpinfowindow.cpp +++ b/qmidiplayer-desktop/qmpinfowindow.cpp @@ -1,4 +1,3 @@ -#include #include "qmpinfowindow.hpp" #include "ui_qmpinfowindow.h" #include "qmpmainwindow.hpp" @@ -51,20 +50,12 @@ void qmpInfoWindow::updateInfo() ui->lbFileName->setText(QString("File name: ") + qmpMainWindow::getInstance()->getFileName()); if (player->getTitle()) { - if (textencoding != "Unicode") - ui->lbTitle->setText(QString("Title: ") + - QTextCodec::codecForName(textencoding.c_str())->toUnicode(player->getTitle())); - else - ui->lbTitle->setText(QString("Title: ") + player->getTitle()); + ui->lbTitle->setText(QString("Title: %1").arg(qmpMainWindow::decodeString(player->getTitle()))); } else ui->lbTitle->setText(QString("Title: ")); if (player->getCopyright()) { - if (textencoding != "Unicode") - ui->lbCopyright->setText(QString("Copyright: ") + - QTextCodec::codecForName(textencoding.c_str())->toUnicode(player->getCopyright())); - else - ui->lbCopyright->setText(QString("Copyright: ") + player->getCopyright()); + ui->lbCopyright->setText(QString("Copyright: %1").arg(qmpMainWindow::decodeString(player->getCopyright()))); } else ui->lbCopyright->setText(QString("Copyright: ")); ui->lbTempo->setText(QString("Tempo: ") + QString::number(player->getTempo(), 'g', 5)); diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index c02a206..9b18e0d 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -1,11 +1,12 @@ #include #include -#include +#include +#include +#include #include #include #include #include -#include #include #include #include @@ -406,19 +407,11 @@ void qmpMainWindow::switchTrack(QString s, bool interrupt) } std::string qmpMainWindow::getTitle() { - if (settings->getOptionEnumIntOptName("Midi/TextEncoding") == "Unicode") - return std::string(player->getTitle()); - return QTextCodec::codecForName( - settings->getOptionEnumIntOptName("Midi/TextEncoding").c_str())-> - toUnicode(player->getTitle()).toStdString(); + return decodeStdString(player->getTitle()); } std::wstring qmpMainWindow::getWTitle() { - if (settings->getOptionEnumIntOptName("Midi/TextEncoding") == "Unicode") - return QString(player->getTitle()).toStdWString(); - return QTextCodec::codecForName( - settings->getOptionEnumIntOptName("Midi/TextEncoding").c_str())-> - toUnicode(player->getTitle()).toStdWString(); + return decodeStdWString(player->getTitle()); } void qmpMainWindow::playerSetup(IFluidSettings *fs) @@ -505,7 +498,16 @@ void qmpMainWindow::registerMidiOptions() settings->registerOptionBool("MIDI", "Send system exclusive messages", "Midi/SendSysEx", true); settings->registerOptionBool("MIDI", "Wait for remaining voice before stopping", "Midi/WaitVoice", true); settings->registerOptionInt("MIDI", "Fluidsynth Device ID", "FluidSynth/DeviceID", 0x00, 0x7E, 0x10); - settings->registerOptionEnumInt("MIDI", "Text encoding", "Midi/TextEncoding", {"Unicode", "Big5", "Big5-HKSCS", "CP949", "EUC-JP", "EUC-KR", "GB18030", "KOI8-R", "KOI8-U", "Macintosh", "Shift-JIS"}, 0); + UErrorCode e = U_ZERO_ERROR; + auto ucnvc = ucnv_countAvailable(); + std::vector converters; + for (auto i = 0; i < ucnvc; ++i) + { + auto n = ucnv_getAvailableName(i); + auto sn = ucnv_getStandardName(n, "MIME", &e); + if (sn) converters.push_back(std::string(sn)); + } + settings->registerOptionEnumInt("MIDI", "Text encoding", "Midi/TextEncoding", converters, 0); } void qmpMainWindow::registerBehaviorOptions() @@ -517,6 +519,43 @@ void qmpMainWindow::registerBehaviorOptions() settings->registerOptionEnumInt("Behavior", "Icon Theme", "Behavior/IconTheme", {"Auto", "Dark", "Light"}, 0); } +QString qmpMainWindow::decodeString(const char *str) +{ + std::string enc("utf-8"); + if (ref && ref->settings) + enc = ref->settings->getOptionEnumIntOptName("Midi/TextEncoding"); + icu::UnicodeString us(str, enc.c_str()); + std::string r; + return QString::fromUtf8(us.toUTF8String(r).c_str()); +} + +std::string qmpMainWindow::decodeStdString(const char *str) +{ + std::string enc("utf-8"); + if (ref && ref->settings) + enc = ref->settings->getOptionEnumIntOptName("Midi/TextEncoding"); + icu::UnicodeString us(str, enc.c_str()); + std::string r; + us.toUTF8String(r); + return r; +} + +std::wstring qmpMainWindow::decodeStdWString(const char *str) +{ + std::string enc("utf-8"); + if (ref && ref->settings) + enc = ref->settings->getOptionEnumIntOptName("Midi/TextEncoding"); + icu::UnicodeString us(str, enc.c_str()); + std::wstring r; + int32_t sz = 0; + UErrorCode e = U_ZERO_ERROR; + u_strToWCS(nullptr, 0, &sz, us.getBuffer(), us.length(), &e); + r.resize(sz + 1); + e = U_ZERO_ERROR; + u_strToWCS(r.data(), r.size(), nullptr, us.getBuffer(), us.length(), &e); + return r; +} + void qmpMainWindow::on_pbPlayPause_clicked() { if (stopped) diff --git a/qmidiplayer-desktop/qmpmainwindow.hpp b/qmidiplayer-desktop/qmpmainwindow.hpp index 7a34cb6..757ec14 100644 --- a/qmidiplayer-desktop/qmpmainwindow.hpp +++ b/qmidiplayer-desktop/qmpmainwindow.hpp @@ -312,6 +312,9 @@ public: { return ref; } + static QString decodeString(const char* str); + static std::string decodeStdString(const char* str); + static std::wstring decodeStdWString(const char* str); }; class qmpRenderFunc: public qmpFuncBaseIntf diff --git a/qmidiplayer-desktop/qmpsettings.cpp b/qmidiplayer-desktop/qmpsettings.cpp index 6ce542a..70cd720 100644 --- a/qmidiplayer-desktop/qmpsettings.cpp +++ b/qmidiplayer-desktop/qmpsettings.cpp @@ -7,7 +7,9 @@ QSettings *qmpSettings::settings = nullptr; qmpSettings::qmpSettings() { +#if QT_VERSION_MAJOR < 6 qRegisterMetaTypeStreamOperators>(); +#endif QString confpath = QStandardPaths::writableLocation(QStandardPaths::StandardLocation::ConfigLocation) + QString("/qmprc"); settings = new QSettings(confpath, QSettings::IniFormat); if (settings->value("ConfigurationFileRevision").toInt() != QMP_CONFIGURATION_FILE_REV && diff --git a/simple-visualization/CMakeLists.txt b/simple-visualization/CMakeLists.txt index 9966c31..6cd408f 100644 --- a/simple-visualization/CMakeLists.txt +++ b/simple-visualization/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(simple-visualization MODULE ) target_link_libraries(simple-visualization - Qt5::Widgets + Qt${QT_VERSION_MAJOR}::Widgets ) install(TARGETS simple-visualization LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/qmidiplayer/) diff --git a/visualization/renderer/CMakeLists.txt b/visualization/renderer/CMakeLists.txt index 106d453..cbe918a 100644 --- a/visualization/renderer/CMakeLists.txt +++ b/visualization/renderer/CMakeLists.txt @@ -18,8 +18,10 @@ add_executable(qmpvisrender ) target_link_libraries(qmpvisrender - Qt5::Core + Qt${QT_VERSION_MAJOR}::Core qmpcore + ICU::uc + ICU::i18n ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ) diff --git a/visualization/renderer/qmppluginapistub.cpp b/visualization/renderer/qmppluginapistub.cpp index 7804cc6..c594f02 100644 --- a/visualization/renderer/qmppluginapistub.cpp +++ b/visualization/renderer/qmppluginapistub.cpp @@ -1,10 +1,11 @@ +#include +#include +#include #include "qmpmidiplay.hpp" #include "qmpvisrendercore.hpp" #include "qmpsettingsro.hpp" #include "qmppluginapistub.hpp" -#include - qmpPluginAPIStub::qmpPluginAPIStub(qmpVisRenderCore *_core): core(_core) { @@ -84,19 +85,24 @@ bool qmpPluginAPIStub::getChannelMask(int ch) } std::string qmpPluginAPIStub::getTitle() { - if (core->settings()->getOptionEnumIntOptName("Midi/TextEncoding") == "Unicode") - return std::string(core->player->getTitle()); - return QTextCodec::codecForName( - core->settings()->getOptionEnumIntOptName("Midi/TextEncoding").c_str())-> - toUnicode(core->player->getTitle()).toStdString(); + std::string enc(core->settings()->getOptionEnumIntOptName("Midi/TextEncoding")); + icu::UnicodeString us(core->player->getTitle(), enc.c_str()); + std::string r; + us.toUTF8String(r); + return r; } std::wstring qmpPluginAPIStub::getWTitle() { - if (core->settings()->getOptionEnumIntOptName("Midi/TextEncoding") == "Unicode") - return QString(core->player->getTitle()).toStdWString(); - return QTextCodec::codecForName( - core->settings()->getOptionEnumIntOptName("Midi/TextEncoding").c_str())-> - toUnicode(core->player->getTitle()).toStdWString(); + std::string enc(core->settings()->getOptionEnumIntOptName("Midi/TextEncoding")); + icu::UnicodeString us(core->player->getTitle(), enc.c_str()); + std::wstring r; + int32_t sz; + UErrorCode e = U_ZERO_ERROR; + u_strToWCS(nullptr, 0, &sz, us.getBuffer(), us.length(), &e); + r.resize(sz + 1); + e = U_ZERO_ERROR; + u_strToWCS(r.data(), r.size(), nullptr, us.getBuffer(), us.length(), &e); + return r; } std::string qmpPluginAPIStub::getFilePath() diff --git a/windows-extra/CMakeLists.txt b/windows-extra/CMakeLists.txt index 6754e46..c9b58ab 100644 --- a/windows-extra/CMakeLists.txt +++ b/windows-extra/CMakeLists.txt @@ -5,12 +5,10 @@ set(windowsextra_SOURCES include_directories(${PROJECT_SOURCE_DIR}/include/) -find_package(Qt5 REQUIRED COMPONENTS Widgets WinExtras) - add_library(windowsextra MODULE ${windowsextra_SOURCES} ) -target_link_libraries(windowsextra Qt5::Widgets Qt5::WinExtras) +target_link_libraries(windowsextra Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::WinExtras) install(TARGETS windowsextra LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/qmidiplayer/) -- cgit v1.2.3