-
Notifications
You must be signed in to change notification settings - Fork 56
/
building-plugins.dox
182 lines (143 loc) · 8.75 KB
/
building-plugins.dox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016
Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
namespace Magnum {
/** @page building-plugins Downloading and building plugins
@brief Guide how to download and build plugins for Magnum engine.
@tableofcontents
Plugins provide additional capability for Magnum engine in terms of importing
and exporting various media file formats. They are not needed for essential
usage, but you will need them sooner or later when you would want to use image
as a texture or render text on the screen.
The source is available on GitHub: https://github.com/mosra/magnum-plugins.
Building plugins is very similar to building Magnum itself. See @ref building
for additonal information about building and running tests, crosscompiling and
platform-specific issues.
Similarly to Magnum, the plugins are build as shared by default. If you are
developing for platform which doesn't support dynamic library loading or if you
just want to link them statically, enable `BUILD_STATIC` to build the plugins
as static. If you plan to use the static plugins with shared libraries later,
enable also position-independent code with `BUILD_STATIC_PIC`. Dynamic plugins
are loaded by the manager on request at runtime, potentially saving memory when the
plugin is not needed, static plugins must be linked in at compile time.
Static plugins built in `Debug` configuration (e.g. with `CMAKE_BUILD_TYPE` set
to `Debug`) have `-d` suffix, *dynamic* plugins in `Debug` configuration are
installed to `magnum-d` subdirectory, similarly to what is done when
@ref building "building Magnum itself".
By default no plugins are built and you need to select them manually:
- `WITH_ANYAUDIOIMPORTER` -- @ref Audio::AnyImporter "AnyAudioImporter"
plugin.
- `WITH_ANYIMAGECONVERTER` -- @ref Trade::AnyImageConverter "AnyImageConverter"
plugin.
- `WITH_ANYIMAGEIMPORTER` -- @ref Trade::AnyImageImporter "AnyImageImporter"
plugin.
- `WITH_ANYSCENEIMPORTER` -- @ref Trade::AnySceneImporter "AnySceneImporter"
plugin.
- `WITH_COLLADAIMPORTER` -- @ref Trade::ColladaImporter "ColladaImporter"
plugin. Enables also building of @ref Trade::TgaImporter "TgaImporter"
plugin.
- `WITH_DDSIMPORTER` -- @ref Trade::DdsImporter "DdsImporter" plugin.
- `WITH_FREETYPEFONT` -- @ref Text::FreeTypeFont "FreeTypeFont" plugin.
- `WITH_HARFBUZZFONT` -- @ref Text::HarfBuzzFont "HarfBuzzFont" plugin.
Enables also building of @ref Text::FreeTypeFont "FreeTypeFont" plugin.
- `WITH_JPEGIMPORTER` -- @ref Trade::JpegImporter "JpegImporter" plugin.
- `WITH_MINIEXRIMAGECONVERTER` -- @ref Trade::MiniExrImageConverter "MiniExrImageConverter"
plugin.
- `WITH_OPENGEXIMPORTER` -- @ref Trade::OpenGexImporter "OpenGexImporter"
plugin.
- `WITH_PNGIMAGECONVERTER` -- @ref Trade::PngImageConverter "PngImageConverter"
plugin.
- `WITH_PNGIMPORTER` -- @ref Trade::PngImporter "PngImporter" plugin.
- `WITH_STANFORDIMPORTER` -- @ref Trade::StanfordImporter "StanfordImporter"
plugin.
- `WITH_STBIMAGEIMPORTER` -- @ref Trade::StbImageImporter "StbImageImporter"
plugin.
- `WITH_STBPNGIMAGECONVERTER` -- @ref Trade::StbPngImageConverter "StbPngImageConverter"
plugin.
- `WITH_STBTRUETYPEFONT` -- @ref Text::StbTrueTypeFont "StbTrueTypeFont"
plugin.
- `WITH_STBVORBISAUDIOIMPORTER` -- @ref Audio::StbVorbisImporter "StbVorbisAudioImporter"
plugin.
Note that each plugin class contains more detailed information about
dependencies, availability on particular platform and also guide how to enable
given library in build and use it with CMake.
@section building-plugins-arch Building ArchLinux packages
In `package/archlinux` directory is currently one package for Git development
build. The package is also in AUR under the same name.
There are also a few development PKGBUILDs in `package/archlinux`, which allow
you to build and install the package directly from source tree without
downloading anything. The native PKGBUILDs also contain `check()` function
which will run all unit tests before packaging.
@section building-plugins-gentoo Gentoo ebuilds
Gentoo Git ebuild is available in `package/gentoo` directory.
@section building-plugins-deb Building DEB packages
There is also `package/debian/` directory with all files needed for building
Debian packages. You need to have `corrade-dev` and `magnum-dev` DEB packages
installed and in addition also `dpkg-dev` and `debhelper` packages. Building is
easy, just change directory to package root, link or copy `package/debian`
directory there and run `dpkg-buildpackage`:
ln -s package/debian .
dpkg-buildpackage
This will compile binary and development packages, which will then appear in
parent directory. If you need to modify CMake flags (enabling/disabling some
plugins, for example), modify the last entry in `debian/rules`.
@subsection building-plugins-brew Homebrew formulas
OS X Homebrew formulas are in `package/homebrew` directory. Download the `*.rb`
file, put it into your Formulas directory and install it using the following
command:
brew install --HEAD magnum-plugins
@section building-plugins-ci Continuous Integration
@subsection building-plugins-ci-travis Travis
In `package/ci/` there is `travis.yml` file with Linux GCC 4.7 and OSX Clang
configuration. Online at https://travis-ci.org/mosra/magnum-plugins.
@subsection building-plugins-ci-appveyor AppVeyor
In `package/ci/` there is `appveyor.yml` file with Windows MSVC configuration.
Online at https://ci.appveyor.com/project/mosra/magnum-plugins.
@subsection building-plugins-ci-jenkins Jenkins
In `package/ci/` there are `jenkins.xml` and `jenkins-gltests.xml` files
containing job configuration, one for build and non-GL tests and the other for
GL tests only. Setup your Jenkins server, enable the **Git** and **Text-finder**
plugin and download the CLI application from here (replace `localhost:8080`
with your server name):
http://localhost:8080/cli
Then add new jobs or update existing ones (update path to the `*.jar` file,
replace `localhost:8080` with your server name, replace `update-job` with
`create-job` if the job doesn't exist yet).
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job MagnumPlugins < package/ci/jenkins.xml
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job MagnumPlugins-GLTests < package/ci/jenkins-gltests.xml
Build is done using **Ninja** build system and everything possible is enabled,
thus you need also **FreeType**, **HarfBuzz**, **libJPEG**, **libPNG** and **Qt4**
libraries. It expects that **GCC** >= 4.9, 4.8, 4.7 and **Clang** are installed
and there are **OpenGL**, **OpenGL ES 2.0** and **OpenGL ES 3.0** librares as
it tries to compile the library with every combination of them. You can
add/remove the axes in `axes/hudson.matrix.TextAxis` or via the web interface
later.
MagnumPlugins-GLTests depend on active X11 session, thus they should be run
from Jenkins instance running on graphical user session.
There is also MinGW-w64, Emscripten, NaCl and Android configuration, add or
update them with the commands below. See @ref building-crosscompiling for more
information about setting up the crosscompilers and `toolchains/` submodule.
For Emscripten you need also **Node.js** installed to run the tests.
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job MagnumPlugins-MinGW-w64 < package/ci/jenkins-mingw-w64.xml
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job MagnumPlugins-Emscripten < package/ci/jenkins-emscripten.xml
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job MagnumPlugins-NaCl < package/ci/jenkins-nacl.xml
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job MagnumPlugins-Android < package/ci/jenkins-android.xml
*/
}