Build & Installation
====================

# linux
1. mkdir build
2. cd build
3. cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_LIBVLC:BOOL=ON -DENABLE_FFMPEG=ON \
     -DENABLE_UDISKS2:BOOL=ON -DENABLE_CATEGORIZED_VIEW:BOOL=ON -DCMAKE_INSTALL_PREFIX=/usr ..
4. make
5. sudo make install

# mac
The following steps are used to compile Cantata, and create the OS X application
bundle.

These steps assume the following structure:

    src/
    build/
    install/

1. Install HomeBrew / macports

2. brew install cmake taglib ffmpeg openssl avahi qt5
   or
   port install cmake taglib ffmpeg openssl avahi qt5

3. Create the icon

    cd src/mac
    ./createicon.sh

4.  Build
    cd build
    export Qt5_DIR="/opt/local/libexec/qt5/lib/cmake"
    cmake -S "../src" -B "./" -DCMAKE_INSTALL_PREFIX="../install" \
		-DENABLE_TAGLIB=ON -DCMAKE_PREFIX_PATH="/opt/local/libexec/qt5/;/opt/local/lib/cmake/Qt5Widgets" \
		-DCMAKE_BUILD_TYPE=Release
    make
    make install

5. Create Installer

   1. Go into the 'mac' folder within the build folder

   2. Run ./create-dmg.sh

Dependencies
============

You require few development packages to be installed. 

VERSION
=======
Update CPACK_PACKAGE_VERSION_MAJOR, CPACK_PACKAGE_VERSION_MINOR, CPACK_PACKAGE_VERSION_PATCH in
CMakeLists.txt, cantata.spec, debian/changelog, debian/cantata.dsc

RPM based Distributions
========================

This is from fedora. You may need to adjust things for another distribution.

taglib-devel libmtp-devel libcdio-paranoia-devel mpg123-devel libmusicbrainz5-devel
qt5-qtmultimedia-devel qt5-qtsvg-devel libudev-devel libebur128-devel libcddb-devel libebur128-devel
avahi-devel pkgconfig(cdparanoia-3) pkgconfig(phonon4qt5) vlc-devel
pkgconfig(taglib-extras) qt5-linguist qtiocompressor-devel libavcodec-free-devel libavformat-free-devel
libavutil-free-devel


RPI
libtag1-dev libmtp-dev libcdio-paranoia-dev libavfilter-dev libmpg123-dev libmusicbrainz5-dev
qtmultimedia5-dev libqt5svg5-dev libudev-dev libebur128-dev libcddb2-dev libebur128-dev libavahi-client-dev

Mac/Windows
-----------
See README
port install taglib qt5 ffmpeg avahi


CMake Options
=============

The following options may be passed to CMake:

    -DCMAKE_INSTALL_PREFIX=/usr
        Specify install location prefix.

    -DCMAKE_BUILD_TYPE=Release|Debug
        Specify which type of build. Debug builds will be *much* larger, as
        they will contain extra debugging information.

    -ENABLE_CATEGORIZED_VIEW=ON
        Enable categorized view. Disabled due to reported crash - #1530
        Default: OFF

    -DENABLE_HTTP_STREAM_PLAYBACK=ON
        Enable support for playing back MPD HTTP streams via QtMultiMedia or
        lib VLC (see below)
        Default: ON

    -DENABLE_LIBVLC=ON
        Enable usage of libVLC for MPD HTTP stream playback. Bug report 493
        (https://github.com/CDrummond/cantata/issues/493) contains
        more information.
        Default: OFF

    -DENABLE_HTTP_SERVER=ON
        Enable usage of internal HTTP server for non-MPD file playback.
        Default: ON

    -DENABLE_PROXY_CONFIG=OFF
        Enable support for proxy settings in config dialog. If disabled,
        system proxy settings are used.
        Default: ON

    -DENABLE_SCROBBLING=OFF
        Enable scrobbling.
        Default: ON

    Linux specific:

    -DENABLE_DEVICES_SUPPORT=ON
        Support external devices (UMS, MTP, AudioCD)
        Default: ON

    -DENABLE_REMOTE_DEVICES=OFF
        Support remote devices (accessed via sshfs, or samba). This requires
        ENABLE_DEVICES_SUPPORT to also be enabled.
        Default: ON

    -DENABLE_UDISKS2=ON
        Build UDisks2 backend for solid-lite.
        Default: ON

    -DINSTALL_UBUNTU_ICONS=ON
        Install Yaru icons for Ubuntu.
        Default: OFF

    -DCANTATA_HELPERS_LIB_DIR=<subdir>
        For 64 bit builds, this may be used to control the lib sub-dir
        where Cantata helper apps will be placed. e.g. setting this to lib64
        will cause the helper apps (cantata-tags, cantata-replaygain) to be
        install into /usr/lib64/cantata instead of /usr/lib/cantata
        Default: <empty (which means /usr/lib will be used) >

    -DENABLE_SIMPLE_MPD_SUPPORT=OFF
        Enable support for basic, Cantata controlled, MPD instance.
        Default: ON

    -DENABLE_AVAHI=ON
        Enable avahi support (automatic mpd discovery)
        Default: ON

    Windows specific:

    -DCANTATA_WINDOWS_INSTALLER_DEST=<folder>
        Path where Inno Setpup Compiler should place the catata setup exe.
        Default: z:\
        
    -DCANTATA_SSL_LIBS=<path>/libeay32.dll;<path>/ssleay32.dll
        SSL libraries
        Default: <empty>
