Installation Instructions
*************************

Li-Ri depends on SDL2 and SDL2_mixer (and their dependencies).

Compilation via conan:
=======================
Install conan (version 1 for now, it is not compatible with conan 2 yet as SDL2_mixer is not yet available) and run it: `conan install . --install-folder=build --build=missing`.

Then, run cmake to generate the build files: `cmake -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DUSE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -S . -B build`.

At last, run cmake to build the executable: `cmake --build build --config Release`.

Compilation via package manager:
================================
Use your favorite tools to install the development packages of SDL2 and SDL2_mixer (preferably latest versions).

Then run cmake to generate the build files: `cmake -DCMAKE_BUILD_TYPE=Release -S . -B build`.

To specify the folder where to look for the data files, you can set the variable `LIRI_DATA_DIR` to the value you want in the cmake invocation: `cmake -DCMAKE_BUILD_TYPE=Release -S . -B build -DLIRI_DATA_DIR=/usr/local/Li-ri/data/`.

At last, run cmake to build the executable: `cmake --build build --config Release`.

Installation:
=============
Adding the option `-DCMAKE_INSTALL_PREFIX=install` will add a new target to install the package in the install/ folder inside your build folder: `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -S . -B build`.

This will copy the binary to the ${CMAKE_INSTALL_PREFIX}/bin/ and data in ${CMAKE_INSTALL_PREFIX}/share/Li-Ri folder (except on Windows where it will copy everything in ${CMAKE_INSTALL_PREFIX}/bin/).

Packaging:
==========
To create a package, use the *package* target from cmake invocation: `cmake --build build --config Release --target package`.
* on Linux, it will create a self extractible tgz file. You can execute it and install it. Then, you can run `bin/Li-ri` from this folder to run Li-Ri.
* on macOS, it will generate a .dmg (that has not been tested at all so it may not run at all).
* on Windows, a NSIS installer (you need to install NSIS on your computer to generate it).
