Fix taglib include path for meson subproject and update README for dependencies.

This commit is contained in:
apoorv569 2021-10-03 18:54:21 +05:30
parent 79cb16324a
commit dd5b5196ee
4 changed files with 62 additions and 22 deletions

View File

@ -48,18 +48,18 @@ SampleHive let's you manage your audio samples in a nice and simple way, just ad
On Arch based distributions, On Arch based distributions,
#+begin_example #+begin_example
sudo pacman -S wxgtk3 wxsvg sqlite taglib yaml-cpp sudo pacman -S wxgtk3 wxsvg sqlite taglib yaml-cpp libsndfile
#+end_example #+end_example
On Debian, Ubuntu and distributions based the on two, On Debian, Ubuntu and distributions based the on two,
#+begin_example #+begin_example
sudo apt install libwxbase3.0-dev libwxgtk-media3.0-gtk3-dev libwxgtk3.0-gtk3-dev wx3.0-headers libsqlite3-dev libyaml-cpp-dev libtagc0-dev libtag1-dev libtagc0 libexif-dev libpango1.0-dev sudo apt install libwxbase3.0-dev libwxgtk-media3.0-gtk3-dev libwxgtk3.0-gtk3-dev wx3.0-headers libsqlite3-dev libyaml-cpp-dev libtagc0-dev libtag1-dev libtagc0 libexif-dev libpango1.0-dev libsndfile1-dev libgstreamer-plugins-base1.0-dev libstreamer-plugins-bad1.0-dev
#+end_example #+end_example
You might also need to install =git=, =meson= and =g++= as well, if you don't already have them installed in order to build SampleHive. You might also need to install =git=, =cmake=, =meson= and =g++= as well, if you don't already have them installed in order to build SampleHive.
/NOTE:/ On Debian and Debian based distributions you also have to install =libwxgtk-media3.0-dev= *NOTE:* On Debian and Debian based distributions you also have to install =libwxgtk-media3.0-dev=
** How to build SampleHive? ** How to build SampleHive?
:PROPERTIES: :PROPERTIES:

View File

@ -42,14 +42,36 @@ config_data.set_quoted('LIBDIR', libdir)
config_data.set_quoted('DATADIR', datadir) config_data.set_quoted('DATADIR', datadir)
config_data.set_quoted('SAMPLEHIVE_DATADIR', samplehive_datadir) config_data.set_quoted('SAMPLEHIVE_DATADIR', samplehive_datadir)
# Create samplehive-config.h based on configuration
config_h = configure_file(output: 'SampleHiveConfig.hpp',
configuration: config_data,)
# Import CMake # Import CMake
cmake = import('cmake') cmake = import('cmake')
cmake_opts = cmake.subproject_options()
cmake_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON', wx_opts = cmake.subproject_options()
wx_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON',
'CMAKE_INSTALL_PREFIX': prefix,
'CMAKE_BUILD_TYPE': 'Release',
'CMAKE_CXX_COMPILER': 'g++',
'wxBUILD_SHARED': 'ON',
'wxBUILD_TESTS': 'OFF',
'wxBUILD_SAMPLES': 'OFF',
'wxBUILD_DEMOS': 'OFF',
'wxBUILD_COMPATIBILITY': '3.0',
'wxUSE_UNICODE': 'ON',
'wxUSE_AUI': 'OFF',
'wxUSE_XML': 'OFF',
'wxUSE_XRC': 'ON',
'wxUSE_HTML': 'ON',
'wxUSE_QA': 'ON',
'wxUSE_PROPGRID': 'OFF',
'wxUSE_RIBBON': 'OFF',
'wxUSE_MDI': 'OFF',
'wxUSE_MDI_ARCHITECTURE': 'OFF',
'wxUSE_RICHTEXT': 'OFF',
'wxUSE_WEBVIEW': 'OFF',
'wxUSE_LIBSDL': 'ON',
'wxUSE_MEDIACTRL': 'ON'})
taglib_opts = cmake.subproject_options()
taglib_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON',
'CMAKE_INSTALL_PREFIX': prefix, 'CMAKE_INSTALL_PREFIX': prefix,
'CMAKE_BUILD_TYPE': 'Release', 'CMAKE_BUILD_TYPE': 'Release',
'CMAKE_CXX_COMPILER': 'g++'}) 'CMAKE_CXX_COMPILER': 'g++'})
@ -78,9 +100,9 @@ wx_found = false
if not wx.found() if not wx.found()
wx_found = false wx_found = false
wx_subproject = cmake.subproject('wxwidgets', options: cmake_opts) wx_subproject = cmake.subproject('wxwidgets', options: wx_opts)
wx_core = wx_subproject.dependency('wxcore')
wx_base = wx_subproject.dependency('wxbase') wx_base = wx_subproject.dependency('wxbase')
wx_core = wx_subproject.dependency('wxcore')
wx_media = wx_subproject.dependency('wxmedia') wx_media = wx_subproject.dependency('wxmedia')
wx = [wx_core, wx_base, wx_media] wx = [wx_core, wx_base, wx_media]
else else
@ -98,15 +120,22 @@ else
endif endif
taglib = dependency('taglib', version: '>=1.12', required: false) taglib = dependency('taglib', version: '>=1.12', required: false)
if not taglib.found() if not taglib.found()
taglib_subproject = cmake.subproject('taglib', options: cmake_opts) taglib_subproject = cmake.subproject('taglib', options: taglib_opts)
taglib = taglib_subproject.dependency('tag') taglib = taglib_subproject.dependency('tag')
else
config_data.set('USE_SYSTEM_INCLUDE_PATH', 1)
endif endif
sqlite3 = dependency('sqlite3', required: true) sqlite3 = dependency('sqlite3', required: true)
yaml = dependency('yaml-cpp', required: true) yaml = dependency('yaml-cpp', required: true)
snd = dependency('sndfile', required: true) snd = dependency('sndfile', required: true)
# Create samplehive-config.h based on configuration
config_h = configure_file(output: 'SampleHiveConfig.hpp',
configuration: config_data,)
install_subdir('assets', install_subdir('assets',
install_dir: samplehive_datadir, install_dir: samplehive_datadir,
exclude_directories: 'screenshots') exclude_directories: 'screenshots')
@ -129,7 +158,6 @@ endif
summary( summary(
{ {
# 'Program name': get_option ('program_name'),
'Debug': get_option('debug'), 'Debug': get_option('debug'),
'Optimization': get_option('optimization'), 'Optimization': get_option('optimization'),
}, },

View File

@ -20,6 +20,10 @@
#pragma once #pragma once
#include "WaveformViewer.hpp"
#include "SampleHiveConfig.hpp"
#include "SH_Event.hpp"
#include <string> #include <string>
#include <wx/button.h> #include <wx/button.h>
@ -55,10 +59,12 @@
#include <taglib/tag.h> #include <taglib/tag.h>
#include <taglib/fileref.h> #include <taglib/fileref.h>
#include <taglib/toolkit/tstring.h>
#include "WaveformViewer.hpp" #ifndef USE_SYSTEM_INCLUDE_PATH
#include "SH_Event.hpp" #include <taglib/toolkit/tstring.h>
#else
#include <taglib/tstring.h>
#endif
struct FileInfo struct FileInfo
{ {

View File

@ -18,11 +18,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include "Tags.hpp"
#include "SampleHiveConfig.hpp"
#include <taglib/tag.h> #include <taglib/tag.h>
#include <taglib/fileref.h> #include <taglib/fileref.h>
#include <taglib/toolkit/tstring.h>
#include "Tags.hpp" #ifndef USE_SYSTEM_INCLUDE_PATH
#include <taglib/toolkit/tstring.h>
#else
#include <taglib/tstring.h>
#endif
Tags::Tags(const std::string& filename) Tags::Tags(const std::string& filename)
: m_Filepath(filename) : m_Filepath(filename)