From 9fecb429a37bcaa577aaa972139f6db3ce17ac50 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 13 Sep 2019 00:52:25 +0800 Subject: CMake. It's happening. Added a new build system based on CMake. Minor code cleanups. This probably breaks building with QMake on multiple platforms. And of course the new CMake support isn't tested thoroughly. But it's finally happening. --- qmidiplayer-desktop/CMakeLists.txt | 62 +++++++++++++++++++++++++++++ qmidiplayer-desktop/qmidiplayer-desktop.pro | 7 ---- qmidiplayer-desktop/qmpmainwindow.cpp | 1 - 3 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 qmidiplayer-desktop/CMakeLists.txt (limited to 'qmidiplayer-desktop') diff --git a/qmidiplayer-desktop/CMakeLists.txt b/qmidiplayer-desktop/CMakeLists.txt new file mode 100644 index 0000000..1f40a2e --- /dev/null +++ b/qmidiplayer-desktop/CMakeLists.txt @@ -0,0 +1,62 @@ +set(qmpdesktop_SOURCES + qdialskulpturestyle.hpp + qmpchanneleditor.hpp + qmpchannelswindow.hpp + qmpcustomizewindow.hpp + qmpdevpropdialog.hpp + qmpefxwindow.hpp + qmphelpwindow.hpp + qmpinfowindow.hpp + qmpmainwindow.hpp + qmpplistwindow.hpp + qmpplugin.hpp + qmppresetselect.hpp + qmpsettingswindow.hpp + main.cpp + qdialskulpturestyle.cpp + qmpchanneleditor.cpp + qmpchannelswindow.cpp + qmpcustomizewindow.cpp + qmpdevpropdialog.cpp + qmpefxwindow.cpp + qmphelpwindow.cpp + qmpinfowindow.cpp + qmpmainwindow.cpp + qmpplistwindow.cpp + qmpplugin.cpp + qmppresetselect.cpp + qmpsettingswindow.cpp + qmpchanneleditor.ui + qmpchannelswindow.ui + qmpcustomizewindow.ui + qmpdevpropdialog.ui + qmpefxwindow.ui + qmphelpwindow.ui + qmpinfowindow.ui + qmpmainwindow.ui + qmpplistwindow.ui + qmppresetselect.ui + qmpsettingswindow.ui + resources.qrc +) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +include_directories(${fluidsynth_INCLUDE_DIRS}) +include_directories(${rtmidi_INCLUDE_DIRS}) +include_directories(${PROJECT_SOURCE_DIR}/include/) + +add_executable(qmidiplayer + ${qmpdesktop_SOURCES} +) + +target_link_libraries(qmidiplayer + Qt5::Widgets + qmpcore + ${fluidsynth_LIBRARIES} + ${rtmidi_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} + ${CMAKE_DL_LIBS} +) diff --git a/qmidiplayer-desktop/qmidiplayer-desktop.pro b/qmidiplayer-desktop/qmidiplayer-desktop.pro index 193c0e5..53fc7c3 100644 --- a/qmidiplayer-desktop/qmidiplayer-desktop.pro +++ b/qmidiplayer-desktop/qmidiplayer-desktop.pro @@ -77,12 +77,6 @@ unix{ message(Building in packaging mode...) DEFINES += QMP_BUILD_UNIX_PACKAGE } - exists("/usr/include/RtMidi.h") { - DEFINES += RT_MIDI_H=\\\"/usr/include/RtMidi.h\\\" - } - exists("/usr/include/rtmidi/RtMidi.h") { - DEFINES += RT_MIDI_H=\\\"/usr/include/rtmidi/RtMidi.h\\\" - } QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_RELEASE += -O3 QMAKE_LFLAGS_RELEASE -= -O1 @@ -113,7 +107,6 @@ unix{ LIBS += -lfluidsynth -lrtmidi -ldl } win32{ - DEFINES += RT_MIDI_H=\\\"RtMidi.h\\\" #change these before building... LIBS += -lfluidsynth -lwinmm -lRtMidi RC_FILE = qmidiplayer.rc diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 95b2da3..e097c62 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -118,7 +118,6 @@ void qmpMainWindow::init() pmgr->scanPlugins();settingsw->updatePluginList(pmgr);pmgr->initPlugins(); ui->vsMasterVol->setValue(qmpSettingsWindow::getSettingsIntf()->value("Audio/Gain",50).toInt()); connect(timer,SIGNAL(timeout()),this,SLOT(updateWidgets())); - connect(timer,SIGNAL(timeout()),chnlw,SLOT(channelWindowsUpdate())); connect(timer,SIGNAL(timeout()),infow,SLOT(updateInfo())); ui->pbNext->setIcon(QIcon(getThemedIcon(":/img/next.svg"))); ui->pbPrev->setIcon(QIcon(getThemedIcon(":/img/prev.svg"))); -- cgit v1.2.3