Skip to content

Latest commit

 

History

History
92 lines (72 loc) · 2.31 KB

File metadata and controls

92 lines (72 loc) · 2.31 KB

Building Element

A simple guide on building Element with CMake. Pease see cmake.org for how to install CMake on your platform.

Submodules

This project uses git submodules. To get them, run: git submodule update --init --recursive

Debian/Ubuntu

Dependencies

The following packages are needed...

sudo apt-get install git build-essential pkg-config libboost-dev \
    libfreetype-dev libx11-dev libxext-dev libxrandr-dev libxcomposite-dev \
    libxinerama-dev libxrender-dev libxcursor-dev libxrender-dev libasound2-dev \
    ladspa-sdk libcurl4-openssl-dev fonts-roboto clang clang++

Compiling

cmake -B build -G Ninja
cmake --build build

Installing

sudo cmake --install build
sudo ldconfig

Arch Linux

Install these packages, then run the cmake commands described above.

sudo pacman -S git base-devel cmake ninja pkgconf boost \
    freetype2 fontconfig libx11 libxext libxrandr libxcomposite \
    libxinerama libxrender libxcursor alsa-lib jack2 \
    ladspa curl ttf-roboto clang

Checking With Docker

You can also build in a Docker container without installing packages on your system:

# Build the Arch Linux environment image
docker build -f Dockerfile.archlinux -t element:archlinux .

# Build the project with your source mounted as a volume
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/workspace element:archlinux bash -c "
  git config --global --add safe.directory /workspace && \
  git submodule update --init --recursive && \
  cmake -B build-arch -G Ninja -DCMAKE_BUILD_TYPE=Release -DELEMENT_BUILD_PLUGINS=ON && \
  cmake --build build-arch && \
  ctest --test-dir build-arch --output-on-failure
"

Or run interactively:

docker run --rm -it --user $(id -u):$(id -g) -v $(pwd):/workspace element:archlinux
# Then run cmake commands manually inside the container

Mac OSX

Dependencies

Install Boost using Homebrew.

brew install boost

Build

cmake -B build
cmake --build build

This will make an app bundle somwhere in the build dir. Run it...

open $(find build -name "Element.app")

Windows (MSVC)

cmake -B build
cmake --build build

After this, you should have an Element.exe inside the build directory.