|
|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
|
|
namespace Magnum { |
|
|
|
/** @page building Downloading and building |
|
|
|
/** @page building Downloading and building |
|
|
|
@brief Guide how to download and build %Magnum on different platforms. |
|
|
|
@brief Guide how to download and build %Magnum on different platforms. |
|
|
|
|
|
|
|
|
|
|
|
@ -15,7 +16,7 @@ Minimal set of tools and libraries required for building is: |
|
|
|
>= 3.1. |
|
|
|
>= 3.1. |
|
|
|
- **CMake** >= 2.8.8 (needed for `OBJECT` library target) |
|
|
|
- **CMake** >= 2.8.8 (needed for `OBJECT` library target) |
|
|
|
- **OpenGL** headers, on Linux most probably shipped with Mesa or |
|
|
|
- **OpenGL** headers, on Linux most probably shipped with Mesa or |
|
|
|
**OpenGL ES 2** headers, if targetting OpenGL ES 2. |
|
|
|
**OpenGL ES 2** headers, if targeting OpenGL ES (see below). |
|
|
|
- **GLEW** - OpenGL extension wrangler |
|
|
|
- **GLEW** - OpenGL extension wrangler |
|
|
|
- **Corrade** - Plugin management and utility library. You can get it at |
|
|
|
- **Corrade** - Plugin management and utility library. You can get it at |
|
|
|
http://github.com/mosra/corrade or at http://mosra.cz/blog/corrade.php. |
|
|
|
http://github.com/mosra/corrade or at http://mosra.cz/blog/corrade.php. |
|
|
|
@ -36,19 +37,45 @@ subdirectory: |
|
|
|
git submodule update |
|
|
|
git submodule update |
|
|
|
|
|
|
|
|
|
|
|
@section building-compilation Compilation, installation |
|
|
|
@section building-compilation Compilation, installation |
|
|
|
The library can be built and installed using these four commands: |
|
|
|
The library (for example with GLUT context) can be built and installed using |
|
|
|
|
|
|
|
these four commands. See below for more information about optional features. |
|
|
|
|
|
|
|
|
|
|
|
mkdir -p build |
|
|
|
mkdir -p build && cd build |
|
|
|
cd build |
|
|
|
cmake .. \ |
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make |
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \ |
|
|
|
|
|
|
|
-DWITH_GLUTCONTEXT=ON |
|
|
|
|
|
|
|
make |
|
|
|
make install |
|
|
|
make install |
|
|
|
|
|
|
|
|
|
|
|
By default the engine is built for desktop OpenGL. If you want to target |
|
|
|
|
|
|
|
OpenGL ES 2, pass `-DTARGET_GLES=True` to CMake. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you want to build with another compiler (e.g. Clang), pass |
|
|
|
If you want to build with another compiler (e.g. Clang), pass |
|
|
|
`-DCMAKE_CXX_COMPILER=clang++` to CMake. |
|
|
|
`-DCMAKE_CXX_COMPILER=clang++` to CMake. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@subsection building-optional Enabling or disabling features |
|
|
|
|
|
|
|
By default the engine is built for desktop OpenGL. If you want to target |
|
|
|
|
|
|
|
OpenGL ES, set `TARGET_GLES` to `ON` or pass `-DTARGET_GLES=ON` to CMake. Note |
|
|
|
|
|
|
|
that some features are available for desktop OpenGL only, see @ref requires-gl. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
By default the engine is built with everything except |
|
|
|
|
|
|
|
@ref Contexts "context libraries". Using `WITH_*` CMake parameters you can |
|
|
|
|
|
|
|
specify which parts will be built and which not: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- `WITH_EVERYTHING` - Defaults to `ON`, builds everything except contexts. If |
|
|
|
|
|
|
|
set to `OFF`, only the main library is built and you can select additional |
|
|
|
|
|
|
|
libraries with the following: |
|
|
|
|
|
|
|
- `WITH_MESHTOOLS` - MeshTools library. |
|
|
|
|
|
|
|
- `WITH_PHYSICS` - Physics library. |
|
|
|
|
|
|
|
- `WITH_PRIMITIVES` - Primitives library. |
|
|
|
|
|
|
|
- `WITH_SHADERS` - Shaders library. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
None of the context libraries is built by default, regardless to |
|
|
|
|
|
|
|
`WITH_EVERYTHING` is enabled or not: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- `WITH_EGLCONTEXT` - X/EGL context, available only if targeting OpenGL ES |
|
|
|
|
|
|
|
(see above). Requires **X11** and **EGL** libraries. |
|
|
|
|
|
|
|
- `WITH_GLUTCONTEXT` - GLUT context, available only if targeting desktop |
|
|
|
|
|
|
|
OpenGL. Requires **GLUT** library. |
|
|
|
|
|
|
|
- `WITH_SDL2CONTEXT` - SDL2 context. Requires **SDL2** library. |
|
|
|
|
|
|
|
|
|
|
|
@subsection building-tests Building and running unit tests |
|
|
|
@subsection building-tests Building and running unit tests |
|
|
|
If you want to build also unit tests (which are not built by default), pass |
|
|
|
If you want to build also unit tests (which are not built by default), pass |
|
|
|
`-DBUILD_TESTS=True` to CMake. Unit tests use QtTest framework (you need at |
|
|
|
`-DBUILD_TESTS=True` to CMake. Unit tests use QtTest framework (you need at |
|
|
|
@ -114,3 +141,4 @@ You may need to modify the `basic-mingw32.cmake` file and |
|
|
|
`CMAKE_INSTALL_PREFIX` to suit your distribution filesystem hierarchy. If |
|
|
|
`CMAKE_INSTALL_PREFIX` to suit your distribution filesystem hierarchy. If |
|
|
|
everything goes well, in `build-win/` subdirectories will be the DLLs. |
|
|
|
everything goes well, in `build-win/` subdirectories will be the DLLs. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
} |
|
|
|
|