Downloading and building extras
Guide how to download and build extras for Magnum engine.
Extras bring additional functionality for the Magnum engine — playground for testing new APIs, specialized stuff that doesn't necessarily need to be a part of the main Magnum repository or mutually exclusive functionality.
Prepared packages
The easiest way to install Magnum Extras is to use one of the ready-made packages for your platform of choice. See Manual build if you want to have more control. Cross-compiling is very similar to cross-compiling of Magnum itself.
- Vcpkg package
- ArchLinux packages
- Packages for Debian, Ubuntu and derivatives
- Gentoo Linux ebuilds
- Homebrew formulas for macOS
Vcpkg package
Magnum Extras are available as a Vcpkg package. See the Magnum Vcpkg documentation for a more detailed introduction and a troubleshooting guide. Installing latest stable version of Magnum Extras with all its dependencies is done like this:
vcpkg install magnum-extras
Note that just a subset of extra libraries is installed by default. To opt-in or opt-out of additional features, you can use the following syntax; feature names are simply names of CMake MAGNUM_WITH_*
options from the Enabling or disabling features section but lowercase, e.g.:
vcpkg install magnum-extras[ui]
To install all features of a package, use *
, e.g.:
vcpkg install magnum-extras[*]
There are also Vcpkg packages for Magnum Plugins and Magnum Integration.
ArchLinux packages
In package/archlinux/magnum-extras-git
there is a package for Git development build. The package is also in AUR as magnum-extras-git. It depends on Corrade, Magnum and Magnum Plugins ArchLinux packages.
There are also a few development packages for native builds, cross-compilation for Emscripten, Android and MinGW or various sanitizer/coverage builds. See the PKGBUILD files in the package/archlinux
directory. They allow you to build and install the package directly from source tree. Example usage:
git clone https://github.com/mosra/magnum-extras && cd magnum-extras cd package/archlinux makepkg -fp PKGBUILD # or any other PKGBUILD file
In most cases the development PKGBUILDs also contain a check()
function which will run all unit tests before packaging. That might sometimes fail or take too long, pass --nocheck
to makepkg
to skip that.
Once built, install the package using pacman
:
sudo pacman -U magnum-extras-*.pkg.tar.zst
Edit the PKGBUILDs if you want to pass additional flags to CMake or enable / disable additional features.
There are also ArchLinux packages for Magnum Integration and Magnum Examples.
Packages for Debian, Ubuntu and derivatives
The package/debian/
directory contains all files needed for building Debian packages. You need the Corrade and Magnum Debian packages installed and in addition also the dpkg-dev
and debhelper
packages. Building is easy, just change directory to package root, link or copy the package/debian
directory there and run dpkg-buildpackage
:
git clone https://github.com/mosra/magnum-extras && cd magnum-extras ln -s package/debian . dpkg-buildpackage --no-sign
This will compile binary and development packages, which will then appear in a parent directory. Install them using dpkg
:
sudo dpkg -i ../magnum-extras*.deb
If you want to pass additional flags to CMake or enable / disable additional features, add them to dh_auto_configure
at the bottom of debian/rules
. Watch out, as indentation has to be done using tabs, not spaces.
There are also Debian packages for Magnum Integration and Magnum Examples.
Gentoo Linux ebuilds
Gentoo Git ebuild is available in the package/gentoo
directory. Get the Corrade, Magnum and Magnum Plugins Gentoo packages first and then build and install Magnum Extras like this:
git clone https://github.com/mosra/magnum-extras && cd magnum-extras cd package/gentoo sudo ebuild dev-libs/magnum-extras/magnum-extras-9999.ebuild manifest clean merge
If you want to pass additional flags to CMake or enable / disable additional features, add them to mycmakeargs
in the *.ebuild
file.
There are also Gentoo packages for Magnum Integration and Magnum Examples.
Homebrew formulas for macOS
macOS Homebrew formulas building the latest Git revision are in the package/homebrew
directory. Either use the *.rb
files directly or use the tap at https:/
brew install mosra/magnum/magnum-extras
But often you may want to install the latest Git revision of all Magnum projects instead:
brew install --HEAD mosra/magnum/corrade brew install --HEAD mosra/magnum/magnum brew install --HEAD mosra/magnum/magnum-plugins brew install --HEAD mosra/magnum/magnum-extras # If already installed, use the following to upgrade, in the same order brew upgrade --fetch-HEAD mosra/magnum/corrade brew upgrade --fetch-HEAD mosra/magnum/magnum brew upgrade --fetch-HEAD mosra/magnum/magnum-plugins brew upgrade --fetch-HEAD mosra/magnum/magnum-extras
When installing from the *.rb
files you need to install the Corrade, Magnum and Magnum Plugins Homebrew packages first. If you want to pass additional flags to CMake or enable / disable additional features, edit the *.rb
file.
There are also Homebrew packages for Magnum Integration and Magnum Examples.
Manual build
The source is available on GitHub: https:/
Enabling or disabling features
Similarly to Magnum, the libraries are build as shared by default. If you are developing for a platform which doesn't support shared libraries or if you just want to link them statically, enable MAGNUM_BUILD_STATIC
to build the libraries as static. If you plan to use them with shared libraries later, enable also position-independent code with MAGNUM_BUILD_STATIC_PIC
.
Libraries built in the Debug
configuration (e.g. with CMAKE_BUILD_TYPE
set to Debug
) have a -d
suffix, similarly to what is done when building Magnum itself.
By default no libraries are built and you need to select them manually:
MAGNUM_WITH_UI
— Build the Ui library. Does not work on OpenGL ES 2.0 / WebGL 1.0 builds of Magnum. Enabled automatically ifMAGNUM_WITH_PLAYER
is enabled.
Besides libraries, the following apps are available, also all disabled by default:
MAGNUM_WITH_PLAYER
– Build the magnum-player executableMAGNUM_WITH_UI_GALLERY
— Build the magnum-ui-gallery executable
Options controlling the build:
MAGNUM_PLAYER_STATIC_PLUGINS
— Static plugins to find and link to the magnum-player executable. Intended for use in scenarios where both Magnum and plugins are built as static, in which case the executable doesn't have a possibility to load dynamic plugins from a filesystem. Expects a semicolon-separated list of existing CMake targets, for exampleMagnum::AnyImageImporter;MagnumPlugins::StbImageImporter
, for each of those a correspondingfind_package()
andtarget_link_libraries()
is called.
Note that each namespace documentation contains more detailed information about its dependencies, availability on particular platforms and also a guide how to enable given library for building and how to use it with CMake.
Building documentation
The documentation for extras is built as part of of the main Magnum documentation. Clone the projects next to each other and continue as described in Building documentation.
Continuous Integration
CircleCI
In package/ci/
there is a circle.yml
file with Linux GCC 4.8, Linux ARM64, macOS, Linux desktop GLES2/GLES3, Emscripten WebGL1/WebGL2, AddressSanitizer, ThreadSanitizer, Android x86 GLES2/GLES3/Vulkan and iOS x86_64 GLES3 configuration. Online at https:/
AppVeyor
In package/ci/
there is an appveyor.yml
file with Windows desktop MSVC, MinGW, Windows desktop GLES2/GLES3 and Windows RT GLES2/GLES3 configuration. Online at https:/
Codecov.io
Linux, Linux GLES, macOS and Windows MinGW builds contribute to a combined code coverage report, available online at https:/