mirror of https://github.com/mosra/magnum.git
8 changed files with 266 additions and 42 deletions
@ -0,0 +1,110 @@
|
||||
/* |
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013 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 cmake Usage with CMake |
||||
@brief Guide how to find and use %Magnum with CMake build system |
||||
|
||||
%Magnum uses CMake build system for both building and integration into your |
||||
projects. The logic is in module `FindMagnum.cmake` distributed with the engine |
||||
in `modules/` directory, you are encouraged to copy it (and its dependencies) |
||||
into your project and add path to the files to `CMAKE_MODULE_PATH`. Otherwise, |
||||
if CMake won't be able to find this file in predefined locations, it will error |
||||
out even if %Magnum might be installed on the system. |
||||
|
||||
Basic usage is: |
||||
|
||||
find_package(Magnum REQUIRED) |
||||
|
||||
This command tries to find base %Magnum library and then defines these |
||||
variables: |
||||
|
||||
- `MAGNUM_FOUND` -- Whether the library was found |
||||
- `MAGNUM_LIBRARIES` -- %Magnum library and dependent libraries |
||||
- `MAGNUM_INCLUDE_DIRS` -- Root include dir and include dirs of dependencies |
||||
- `MAGNUM_PLUGINS_IMPORTER_DIR` -- Directory with importer plugins |
||||
|
||||
However, this command will try to find only the base library, not the optional |
||||
components. The base library depends on %Corrade, OpenGL and GLEW libraries (or |
||||
OpenGL ES libraries). Additional dependencies are specified by the components. |
||||
The optional components are: |
||||
|
||||
- `%DebugTools` -- DebugTools library (depends on `%MeshTools`, `%Physics`, |
||||
`%Primitives`, `%SceneGraph` and `%Shaders` components) |
||||
- `%MeshTools` -- MeshTools library |
||||
- `%Physics` -- Physics library (depends on `%SceneGraph` component) |
||||
- `%Primitives` -- Primitives library |
||||
- `%SceneGraph` -- SceneGraph library |
||||
- `%Shaders` -- Shaders library |
||||
- `%Text` -- Text library (depends on `%TextureTools` component, FreeType |
||||
library and possibly HarfBuzz library, see below) |
||||
- `%TextureTools` -- TextureTools library |
||||
|
||||
Platform namespace is split into more components: |
||||
|
||||
- `%GlutApplication` -- @ref Platform::GlutApplication "GlutApplication" |
||||
(depends on GLUT library) |
||||
- `%GlxApplication` -- @ref Platform::GlxApplication "GlxApplication" (depends |
||||
on GLX and X11 libraries) |
||||
- `%NaClApplication` -- @ref Platform::NaClApplication "NaClApplication" |
||||
(only if targeting Google Chrome Native Client) |
||||
- `%Sdl2Application` -- @ref Platform::Sdl2Application "Sdl2Application" |
||||
(depends on SDL2 library) |
||||
- `%XEglApplication` -- @ref Platform::XEglApplication "XEglApplication" |
||||
(depends on EGL and X11 libraries) |
||||
- `%WindowlessGlxApplication` -- @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" |
||||
(depends on GLX and X11 libraries) |
||||
|
||||
Example usage with specifying additional components is: |
||||
|
||||
find_package(Magnum REQUIRED MeshTools Primitives GlutApplication) |
||||
|
||||
For each component is then defined: |
||||
|
||||
- `MAGNUM_*_FOUND` -- Whether the component was found |
||||
- `MAGNUM_*_LIBRARIES` -- Component library and dependent libraries |
||||
- `MAGNUM_*_INCLUDE_DIRS` -- Include dirs of module dependencies |
||||
|
||||
If exactly one `*Application` or exactly one `Windowless*Application` component |
||||
is requested and found, its libraries and include dirs are available in |
||||
convenience aliases `MAGNUM_APPLICATION_LIBRARIES` / |
||||
`MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES` and `MAGNUM_APPLICATION_INCLUDE_DIRS` |
||||
/ `MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS` to simplify porting. |
||||
|
||||
Features of found %Magnum library are exposed in these CMake variables, they |
||||
are also available as preprocessor variables if including Magnum.h: |
||||
|
||||
- `MAGNUM_TARGET_GLES` -- Defined if compiled for OpenGL ES |
||||
- `MAGNUM_TARGET_GLES2` -- Defined if compiled for OpenGL ES 2.0 |
||||
- `MAGNUM_TARGET_DESKTOP_GLES` -- Defined if compiled with OpenGL ES emulation |
||||
on desktop OpenGL |
||||
- `MAGNUM_TARGET_NACL` -- Defined if compiled for Google Chrome Native Client |
||||
- `MAGNUM_USE_HARFBUZZ` -- Defined if HarfBuzz library is used for text |
||||
rendering |
||||
|
||||
%Corrade library provides also its own set of CMake macros and variables, see |
||||
@ref corrade-cmake "its documentation" for more information. |
||||
|
||||
*/ |
||||
} |
||||
Loading…
Reference in new issue