From d5dfa9292a446d1a916c32d58c2c121d0d6cd07e Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 6 Oct 2019 08:32:38 +0800 Subject: I love Windows. New build instructions using cmake. Fixed Windows version of qmpPluginManager::scanPlugins. Fixed wrong linking order (?). --- INSTALL.md | 51 +++++++++++++++++---------------------- qmidiplayer-desktop/qmpplugin.cpp | 4 +-- visualization/CMakeLists.txt | 4 +-- 3 files changed, 26 insertions(+), 33 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index fedeba9..028c06d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,36 +1,29 @@ # General instructions -Use qmake or Qt Creator. + +``` +git clone --recurse-submodules https://git.chrisoft.org/git/QMidiPlayer.git +mkdir build && cd build && cmake .. && make -j$(nproc) +``` Dependencies: -> libfluidsynth 2.x, Qt5, Qt quick controls(lite version) and RtMidi. +> cmake (3.10), pkg-config, libfluidsynth 2.x, RtMidi and Qt5. + +If you want to build the default visualization plugin, you need some additional libraries: + +> glfw3, glew, DevIL, zlib, freetype C++14 is _required_ to build the project. -To build the default visualization plugin, you need the latest SMELT library -(along with all its dependencies), which can be found -[here](https://github.com/BearKidsTeam/SMELT). - -Some dependencies in the project file are hard-coded paths. You may -have to modify them first. Alternatively, you can set the environmental -variable `SMELT_DIR` to where your SMELT build is. - -If you don't want to build the default visualization plugin, just remove -the line containing "visualization" in qmidiplayer.pro. - -# Instruction for dumbs - -1. Get SMELT [here](https://github.com/BearKidsTeam/SMELT). -2. Get the source code [here](https://github.com/chirs241097/QMidiPlayer). -3. The following steps are done in an interactive shell. -4. Change directory (`cd`) to the folder with the source code of SMELT. - type `make` to build it. -5. Type `export QMP_BUILD_MODE=1` to allow QMP to scan plugins in - /usr/lib/qmidiplayer. -6. Type `export SMELT_DIR=` in order - to tell qmake where SMELT is. -7. Change directory to the folder with the source code of QMidiPlayer. - type `qmake` and then `make` to build it. Appending `PREFIX=/usr` to `qmake` - is highly recommended because QMidiPlayer only scans for plugins in - working directory and /usr/lib/qmidiplayer at this moment. -8. Use `sudo make install` to install QMidiPlayer. +Check out `make edit_cache` for more options. + +Lite version is currently not built. + +# Using Windows? + +Since `pkg-config` is barely usable on Windows, the answer is I don't know. +Currently I use [mxe](https://mxe.cc) for Windows builds. + +If you are using msvc, I would recommend trying out [this fork](https://github.com/chirs241097/fluidsynth-sans-glib/) +of fluidsynth to reduce your potential pain when building QMidiPlayer. + diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp index 1c83524..875a689 100644 --- a/qmidiplayer-desktop/qmpplugin.cpp +++ b/qmidiplayer-desktop/qmpplugin.cpp @@ -20,10 +20,10 @@ std::string wstr2str(std::wstring s) std::wstring_convert,wchar_t> wsc; return wsc.to_bytes(s); } -void qmpPluginManager::scanPlugins() +void qmpPluginManager::scanPlugins(const std::vector &pp) { QDirIterator *dir; - std::vector cpluginpaths; + std::vector cpluginpaths(pp); dir=new QDirIterator(QCoreApplication::applicationDirPath()+"/plugins/"); while(dir->hasNext()) { diff --git a/visualization/CMakeLists.txt b/visualization/CMakeLists.txt index fb88e10..3e86c37 100644 --- a/visualization/CMakeLists.txt +++ b/visualization/CMakeLists.txt @@ -27,10 +27,10 @@ add_library(visualization MODULE ) target_link_libraries(visualization - ${FREETYPE_LIBRARIES} - ${ZLIB_LIBRARIES} smeltext smelt + ${FREETYPE_LIBRARIES} + ${ZLIB_LIBRARIES} ${IL_LIBRARIES} glfw ${GLEW_LIBRARIES} -- cgit v1.2.3