From b9ca288b6941ccf0b1db21375843faf4a10b6211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Oct 2013 11:52:53 +0100 Subject: [PATCH 01/56] doc: minor formatting changes. --- doc/building.dox | 58 +++++++++++++++++----------------- doc/cmake.dox | 68 ++++++++++++++++++++-------------------- modules/FindMagnum.cmake | 2 +- 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index 800f3c569..2866f5161 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -140,40 +140,40 @@ By default the engine is built with nearly everything except Audio library and application libraries (see below). Using `WITH_*` CMake parameters you can specify which parts will be built and which not: - - `WITH_AUDIO` - Audio library. Depends on **OpenAL** library, not built by - default. - - `WITH_DEBUGTOOLS` - DebugTools library. Enables also building of MeshTools, - Primitives, SceneGraph, Shaders and Shapes libraries. - - `WITH_MESHTOOLS` - MeshTools library. Enabled automatically if `WITH_DEBUGTOOLS` - is enabled. - - `WITH_PRIMITIVES` - Primitives library. Enabled automatically if `WITH_DEBUGTOOLS` - is enabled. - - `WITH_SCENEGRAPH` - SceneGraph library. Enabled automatically if `WITH_DEBUGTOOLS` - or `WITH_SHAPES` is enabled. - - `WITH_SHADERS` - Shaders library. Enabled automatically if `WITH_DEBUGTOOLS` - is enabled. - - `WITH_SHAPES` - Shapes library. Enables also building of SceneGraph library. - Enabled automatically if `WITH_DEBUGTOOLS` is enabled. - - `WITH_TEXT` - Text library. Enables also building of TextureTools library. - - `WITH_TEXTURETOOLS` - TextureTools library. Enabled automatically if `WITH_TEXT` - or `WITH_DISTANCEFIELDCONVERTER` is enabled. - - `WITH_MAGNUMINFO` - `magnum-info` executable, provides information about the - engine and OpenGL capabilities. - - `WITH_DISTANCEFIELDCONVERTER` - `magnum-distancefield` executable for - converting black&white images to distance field textures. Enables also - building of TextureTools library. +- `WITH_AUDIO` - Audio library. Depends on **OpenAL** library, not built by + default. +- `WITH_DEBUGTOOLS` - DebugTools library. Enables also building of MeshTools, + Primitives, SceneGraph, Shaders and Shapes libraries. +- `WITH_MESHTOOLS` - MeshTools library. Enabled automatically if + `WITH_DEBUGTOOLS` is enabled. +- `WITH_PRIMITIVES` - Primitives library. Enabled automatically if + `WITH_DEBUGTOOLS` is enabled. +- `WITH_SCENEGRAPH` - SceneGraph library. Enabled automatically if + `WITH_DEBUGTOOLS` or `WITH_SHAPES` is enabled. +- `WITH_SHADERS` - Shaders library. Enabled automatically if `WITH_DEBUGTOOLS` + is enabled. +- `WITH_SHAPES` - Shapes library. Enables also building of SceneGraph + library. Enabled automatically if `WITH_DEBUGTOOLS` is enabled. +- `WITH_TEXT` - Text library. Enables also building of TextureTools library. +- `WITH_TEXTURETOOLS` - TextureTools library. Enabled automatically if + `WITH_TEXT` or `WITH_DISTANCEFIELDCONVERTER` is enabled. +- `WITH_MAGNUMINFO` - `magnum-info` executable, provides information about + the engine and OpenGL capabilities. +- `WITH_DISTANCEFIELDCONVERTER` - `magnum-distancefield` executable for + converting black&white images to distance field textures. Enables also + building of TextureTools library. None of the @ref Platform "application libraries" is built by default (and you need at least one). Choose the one which suits your requirements and your platform best: -- `WITH_GLUTAPPLICATION` - @ref Platform::GlutApplication "GlutApplication" -- `WITH_GLXAPPLICATION` - @ref Platform::GlxApplication "GlxApplication" -- `WITH_NACLAPPLICATION` - @ref Platform::NaClApplication "NaClApplication" -- `WITH_SDL2APPLICATION` - @ref Platform::Sdl2Application "Sdl2Application" -- `WITH_XEGLAPPLICATION` - @ref Platform::XEglApplication "XEglApplication" -- `WITH_WINDOWLESSGLXAPPLICATION` - @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" -- `WITH_WINDOWLESSNACLAPPLICATION` - @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" +- `WITH_GLUTAPPLICATION` - @ref Platform::GlutApplication "GlutApplication" +- `WITH_GLXAPPLICATION` - @ref Platform::GlxApplication "GlxApplication" +- `WITH_NACLAPPLICATION` - @ref Platform::NaClApplication "NaClApplication" +- `WITH_SDL2APPLICATION` - @ref Platform::Sdl2Application "Sdl2Application" +- `WITH_XEGLAPPLICATION` - @ref Platform::XEglApplication "XEglApplication" +- `WITH_WINDOWLESSGLXAPPLICATION` - @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" +- `WITH_WINDOWLESSNACLAPPLICATION` - @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" Note that [each namespace](namespaces.html) and all @ref Platform libraries contain more detailed information about dependencies, availability on diff --git a/doc/cmake.dox b/doc/cmake.dox index fbea44ae0..5fc320b9d 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -40,37 +40,37 @@ Basic usage is: 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_FONT_DIR` -- Directory with font plugins -- `MAGNUM_PLUGINS_IMPORTER_DIR` -- Directory with importer plugins +- `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_FONT_DIR` -- Directory with font plugins +- `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 and OpenGL libraries (or OpenGL ES libraries). Additional dependencies are specified by the components. The optional components are: -- `%Audio` -- Audio library -- `%DebugTools` -- DebugTools library (depends on `%MeshTools`, - `%Primitives`, `%SceneGraph`, `%Shaders` and `%Shapes` components) -- `%MeshTools` -- MeshTools library -- `%Primitives` -- Primitives library -- `%SceneGraph` -- SceneGraph library -- `%Shaders` -- Shaders library -- `%Shapes` -- Shapes library (depends on `%SceneGraph` component) -- `%Text` -- Text library (depends on `%TextureTools` component) -- `%TextureTools` -- TextureTools library +- `%Audio` -- Audio library +- `%DebugTools` -- DebugTools library (depends on `%MeshTools`, + `%Primitives`, `%SceneGraph`, `%Shaders` and `%Shapes` components) +- `%MeshTools` -- MeshTools library +- `%Primitives` -- Primitives library +- `%SceneGraph` -- SceneGraph library +- `%Shaders` -- Shaders library +- `%Shapes` -- Shapes library (depends on `%SceneGraph` component) +- `%Text` -- Text library (depends on `%TextureTools` component) +- `%TextureTools` -- TextureTools library Platform namespace is split into more components: -- `%GlutApplication` -- @ref Platform::GlutApplication "GlutApplication" -- `%GlxApplication` -- @ref Platform::GlxApplication "GlxApplication" -- `%NaClApplication` -- @ref Platform::NaClApplication "NaClApplication" -- `%Sdl2Application` -- @ref Platform::Sdl2Application "Sdl2Application" -- `%XEglApplication` -- @ref Platform::XEglApplication "XEglApplication" -- `%WindowlessNaClApplication` -- @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" -- `%WindowlessGlxApplication` -- @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" +- `%GlutApplication` -- @ref Platform::GlutApplication "GlutApplication" +- `%GlxApplication` -- @ref Platform::GlxApplication "GlxApplication" +- `%NaClApplication` -- @ref Platform::NaClApplication "NaClApplication" +- `%Sdl2Application` -- @ref Platform::Sdl2Application "Sdl2Application" +- `%XEglApplication` -- @ref Platform::XEglApplication "XEglApplication" +- `%WindowlessGlxApplication` -- @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" +- `%WindowlessNaClApplication` -- @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" Note that [each namespace](namespaces.html) and all @ref Platform libraries contain more detailed information about dependencies, availability on @@ -83,9 +83,9 @@ Example usage with specifying additional components is: 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 +- `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 @@ -96,15 +96,15 @@ convenience aliases `MAGNUM_APPLICATION_LIBRARIES` / Features of found %Magnum library are exposed in these CMake variables, they are also available as preprocessor variables if including Magnum.h: -- `MAGNUM_BUILD_DEPRECATED` -- Defined if compiled with deprecated APIs - included -- `MAGNUM_BUILD_STATIC` -- Defined if built as static libraries. Default are - shared libraries. -- `MAGNUM_TARGET_GLES` -- Defined if compiled for OpenGL ES -- `MAGNUM_TARGET_GLES2` -- Defined if compiled for OpenGL ES 2.0 -- `MAGNUM_TARGET_GLES3` -- Defined if compiled for OpenGL ES 3.0 -- `MAGNUM_TARGET_DESKTOP_GLES` -- Defined if compiled with OpenGL ES emulation - on desktop OpenGL +- `MAGNUM_BUILD_DEPRECATED` -- Defined if compiled with deprecated APIs + included +- `MAGNUM_BUILD_STATIC` -- Defined if built as static libraries. Default are + shared libraries. +- `MAGNUM_TARGET_GLES` -- Defined if compiled for OpenGL ES +- `MAGNUM_TARGET_GLES2` -- Defined if compiled for OpenGL ES 2.0 +- `MAGNUM_TARGET_GLES3` -- Defined if compiled for OpenGL ES 3.0 +- `MAGNUM_TARGET_DESKTOP_GLES` -- Defined if compiled with OpenGL ES + emulation on desktop OpenGL %Corrade library provides also its own set of CMake macros and variables, see @ref corrade-cmake "its documentation" for more information. diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index c6223bf79..5670489d8 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -35,8 +35,8 @@ # NaClApplication - NaCl application # Sdl2Application - SDL2 application # XEglApplication - X/EGL application -# WindowlessNaClApplication - Windowless NaCl application # WindowlessGlxApplication - Windowless GLX application +# WindowlessNaClApplication - Windowless NaCl application # Example usage with specifying additional components is: # find_package(Magnum [REQUIRED|COMPONENTS] # MeshTools Primitives GlutApplication) From 3fb969d3974fccad95d44ecc141f27ac3ceea29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Oct 2013 12:06:44 +0100 Subject: [PATCH 02/56] Integrated plugins into build system and updated the documentation. --- CMakeLists.txt | 14 +++ doc/building.dox | 23 +++- doc/cmake.dox | 37 +++++- modules/FindMagnum.cmake | 107 +++++++++++------- src/CMakeLists.txt | 1 + src/Plugins/CMakeLists.txt | 54 +++++++++ src/Plugins/MagnumFont/CMakeLists.txt | 12 +- src/Plugins/MagnumFont/MagnumFont.h | 5 +- .../MagnumFontConverter/CMakeLists.txt | 11 +- .../MagnumFontConverter/MagnumFontConverter.h | 4 +- src/Plugins/TgaImageConverter/CMakeLists.txt | 4 +- .../TgaImageConverter/TgaImageConverter.h | 4 +- src/Plugins/TgaImporter/CMakeLists.txt | 4 +- src/Plugins/TgaImporter/TgaImporter.h | 4 +- src/Plugins/WavAudioImporter/CMakeLists.txt | 8 +- src/Plugins/WavAudioImporter/WavImporter.h | 4 +- 16 files changed, 211 insertions(+), 85 deletions(-) create mode 100644 src/Plugins/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index cf353cdd6..ba2c1ffea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,13 @@ else() option(WITH_SDL2APPLICATION "Build Sdl2Application library" OFF) endif() +# Plugins +cmake_dependent_option(WITH_MAGNUMFONT "Build MagnumFont plugin" OFF "WITH_TEXT" OFF) +cmake_dependent_option(WITH_MAGNUMFONTCONVERTER "Build MagnumFontConverter plugin" OFF "NOT MAGNUM_TARGET_GLES;WITH_TEXT" OFF) +cmake_dependent_option(WITH_TGAIMAGECONVERTER "Build TgaImageConverter plugin" OFF "NOT WITH_MAGNUMFONTCONVERTER" ON) +cmake_dependent_option(WITH_TGAIMPORTER "Build TgaImporter plugin" OFF "NOT WITH_MAGNUMFONT" ON) +cmake_dependent_option(WITH_WAVAUDIOIMPORTER "Build WavAudioImporter plugin" OFF "WITH_AUDIO" OFF) + option(BUILD_DEPRECATED "Include deprecated API in the build" ON) if(BUILD_DEPRECATED) set(MAGNUM_BUILD_DEPRECATED 1) @@ -134,9 +141,16 @@ endif() include(CorradeLibSuffix) set(MAGNUM_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin) set(MAGNUM_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) +set(MAGNUM_PLUGINS_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum) +set(MAGNUM_PLUGINS_FONT_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONTCONVERTER_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/fontconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/audioimporters) set(MAGNUM_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/magnum) set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules) set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum) +set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum/Plugins) add_subdirectory(external) add_subdirectory(modules) diff --git a/doc/building.dox b/doc/building.dox index 2866f5161..1f6570072 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -136,9 +136,9 @@ CMake and C++ sources, see @ref cmake and @ref src/Magnum.h for more information. See also @ref corrade-cmake and @ref src/Corrade.h for additional information. -By default the engine is built with nearly everything except Audio library and -application libraries (see below). Using `WITH_*` CMake parameters you can -specify which parts will be built and which not: +By default the engine is built with nearly everything except Audio library, +plugins and application libraries (see below). Using `WITH_*` CMake parameters +you can specify which parts will be built and which not: - `WITH_AUDIO` - Audio library. Depends on **OpenAL** library, not built by default. @@ -175,6 +175,23 @@ platform best: - `WITH_WINDOWLESSGLXAPPLICATION` - @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" - `WITH_WINDOWLESSNACLAPPLICATION` - @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" +Magnum also contains a set of dependency-less plugins for importing essential +file formats. Additional plugins are provided in separate plugin repository, +see @ref building-plugins for more information. None of the plugins is built by +default. + +- `WITH_MAGNUMFONT` -- @ref Text::MagnumFont "MagnumFont" plugin. Available + only if `WITH_TEXT` is enabled. Enables also building of + @ref Trade::TgaImporter "TgaImporter" plugin. +- `WITH_MAGNUMFONTCONVERTER` -- @ref Text::MagnumFontConverter "MagnumFontConverter" + plugin. Available only if `WITH_TEXT` is enabled. Enables also building of + @ref Trade::TgaImageConverter "TgaImageConverter" plugin. +- `WITH_TGAIMPORTER` -- @ref Trade::TgaImporter "TgaImporter" plugin. +- `WITH_TGAIMAGECONVERTER` -- @ref Trade::TgaImageConverter "TgaImageConverter" + plugin. +- `WITH_WAVAUDIOIMPORTER` -- @ref Audio::WavImporter "WavAudioImporter" + plugin. Available only if `WITH_AUDIO` is enabled. + Note that [each namespace](namespaces.html) and all @ref Platform libraries contain more detailed information about dependencies, availability on particular platform and also guide how to enable given library in build and use diff --git a/doc/cmake.dox b/doc/cmake.dox index 5fc320b9d..ae37c4cc5 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -43,8 +43,17 @@ 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_DIR` -- Base directory with plugins. You can modify it + (e.g. set it to `.` when deploying on Windows with plugins stored + relatively to the executable), the following `MAGNUM_PLUGINS_*_DIR` + variables depend on it. +- `MAGNUM_PLUGINS_INCLUDE_DIR -- Include dir with plugins - `MAGNUM_PLUGINS_FONT_DIR` -- Directory with font plugins +- `MAGNUM_PLUGINS_FONTCONVERTER_DIR` -- Directory with font converter plugins +- `MAGNUM_PLUGINS_IMAGECONVERTER_DIR` -- Directory with image converter + plugins - `MAGNUM_PLUGINS_IMPORTER_DIR` -- Directory with importer plugins +- `MAGNUM_PLUGINS_AUDIOIMPORTER_DIR` -- Directory with audio importer plugins However, this command will try to find only the base library, not the optional components. The base library depends on %Corrade and OpenGL libraries (or @@ -72,10 +81,30 @@ Platform namespace is split into more components: - `%WindowlessGlxApplication` -- @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" - `%WindowlessNaClApplication` -- @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" -Note that [each namespace](namespaces.html) and all @ref Platform libraries -contain more detailed information about dependencies, availability on -particular platform and also guide how to enable given library in build and use -it with CMake. +The library also contains a set of plugins for importing essential file +formats. Additional plugins are provided in separate plugin repository, see +@ref cmake-plugins for more information. If you are going to use dynamic +plugins (the default) via plugin manager, they don't need to be handled via +CMake. The manager will look for them at runtime at specified location and +loads them dynamically. However, if they are built as static (see +@ref building-plugins for more information), they need to be linked into the +executable and then explicitly imported. Also if you are going to use them as +dependencies, you need to find the dependency and then link to it. + +- `MagnumFont` -- @ref Text::MagnumFont "MagnumFont" plugin (depends on + `%Text` component and `TgaImporter` plugin) +- `MagnumFontConverter` -- @ref Text::MagnumFontConverter "MagnumFontConverter" + plugin (depends on `%Text` component and `%TgaImageConverter` plugin) +- `TgaImageConverter` -- @ref Trade::TgaImageConverter "TgaImageConverter" + plugin +- `TgaImporter` -- @ref Trade::TgaImporter "TgaImporter" plugin +- `WavAudioImporter` -- @ref Audio::WavImporter "WavAudioImporter" plugin + (depends on `%Audio` component) + +Note that [each namespace](namespaces.html), all @ref Platform libraries and +each plugin class contain more detailed information about dependencies, +availability on particular platform and also guide how to enable given library +in build and use it with CMake. Example usage with specifying additional components is: diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 5670489d8..4991b5758 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -7,6 +7,7 @@ # MAGNUM_LIBRARIES - Magnum library and dependent libraries # MAGNUM_INCLUDE_DIRS - Root include dir and include dirs of # dependencies +# MAGNUM_PLUGINS_INCLUDE_DIR - Include dir with plugins # MAGNUM_PLUGINS_DIR - Base directory with plugins. You can modify # it (e.g. set it to `.` when deploying on Windows with plugins stored # relatively to the executable), the following MAGNUM_PLUGINS_*_DIR @@ -30,6 +31,13 @@ # Shapes - Shapes library (depends on SceneGraph component) # Text - Text library (depends on TextureTools component) # TextureTools - TextureTools library +# MagnumFont - Magnum bitmap font plugin (depends on Text component +# and TgaImporter plugin) +# MagnumFontConverter - Magnum bitmap font converter plugin (depends on Text +# component and TgaImageConverter plugin) +# TgaImageConverter - TGA image converter plugin +# TgaImporter - TGA importer plugin +# WavAudioImporter - WAV audio importer plugin (depends on Audio component) # GlutApplication - GLUT application # GlxApplication - GLX application # NaClApplication - NaCl application @@ -167,15 +175,66 @@ endif() foreach(component ${Magnum_FIND_COMPONENTS}) string(TOUPPER ${component} _COMPONENT) - # Find the library - find_library(MAGNUM_${_COMPONENT}_LIBRARY Magnum${component}) + # AudioImporter plugin specific name suffixes + if(${component} MATCHES ".+AudioImporter$") + set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX audioimporters) + + # Audio importer class is Audio::*Importer, thus we need to convert + # *AudioImporter.h to *Importer.h + string(REPLACE "AudioImporter" "Importer" _MAGNUM_${_COMPONENT}_HEADER_NAME "${component}") + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${_MAGNUM_${_COMPONENT}_HEADER_NAME}.h) + + # Importer plugin specific name suffixes + elseif(${component} MATCHES ".+Importer$") + set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX importers) + + # Font plugin specific name suffixes + elseif(${component} MATCHES ".+Font$") + set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX fonts) + + # ImageConverter plugin specific name suffixes + elseif(${component} MATCHES ".+ImageConverter$") + set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX imageconverters) + + # FontConverter plugin specific name suffixes + elseif(${component} MATCHES ".+FontConverter$") + set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX fontconverters) + endif() + + # Set plugin defaults, find the plugin + if(_MAGNUM_${_COMPONENT}_IS_PLUGIN) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Plugins/${component}) + + # Don't override the one for *AudioImporter plugins + if(NOT _MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${component}.h) + endif() - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX ${component}) + # Dynamic plugins don't have any prefix (e.g. `lib` on Linux), search + # with empty prefix and then reset that back so we don't accidentaly + # break something else + set(_tmp_prefixes ${CMAKE_FIND_LIBRARY_PREFIXES}) + set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "") + find_library(MAGNUM_${_COMPONENT}_LIBRARY ${component} + PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) + set(CMAKE_FIND_LIBRARY_PREFIXES ${_tmp_prefixes}) + + # Set library defaults, find the library + else() + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX ${component}) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${component}.h) + + find_library(MAGNUM_${_COMPONENT}_LIBRARY Magnum${component}) + endif() # Applications if(${component} MATCHES .+Application) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Platform) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${component}.h) # GLUT application dependencies if(${component} STREQUAL GlutApplication) @@ -223,12 +282,9 @@ foreach(component ${Magnum_FIND_COMPONENTS}) unset(MAGNUM_${_COMPONENT}_LIBRARY) endif() endif() - endif() # Audio library - if(${component} STREQUAL Audio) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Audio.h) - + elseif(${component} STREQUAL Audio) find_package(OpenAL) if(OPENAL_FOUND) set(_MAGNUM_${_COMPONENT}_LIBRARIES ${OPENAL_LIBRARY}) @@ -236,45 +292,17 @@ foreach(component ${Magnum_FIND_COMPONENTS}) else() unset(MAGNUM_${_COMPONENT}_LIBRARY) endif() - endif() - - # DebugTools library - if(${component} STREQUAL DebugTools) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES DebugTools.h) - endif() # Mesh tools library - if(${component} STREQUAL MeshTools) + elseif(${component} STREQUAL MeshTools) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h) - endif() # Primitives library - if(${component} STREQUAL Primitives) + elseif(${component} STREQUAL Primitives) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Cube.h) - endif() - - # Scene graph library - if(${component} STREQUAL SceneGraph) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES SceneGraph.h) - endif() - - # Shaders library - if(${component} STREQUAL Shaders) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Shaders.h) - endif() - - # Shapes library - if(${component} STREQUAL Shapes) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Shapes.h) - endif() - - # Text library - if(${component} STREQUAL Text) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Text.h) - endif() # TextureTools library - if(${component} STREQUAL TextureTools) + elseif(${component} STREQUAL TextureTools) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h) endif() @@ -367,6 +395,7 @@ set(MAGNUM_PLUGINS_DIR ${MAGNUM_PLUGINS_INSTALL_DIR} CACHE PATH "Base directory where to look for Magnum plugins") # Plugin directories +set(MAGNUM_PLUGINS_INCLUDE_DIR ${MAGNUM_INCLUDE_DIR}/Plugins) set(MAGNUM_PLUGINS_FONT_DIR ${MAGNUM_PLUGINS_DIR}/fonts) set(MAGNUM_PLUGINS_FONTCONVERTER_DIR ${MAGNUM_PLUGINS_DIR}/fontconverters) set(MAGNUM_PLUGINS_IMAGECONVERTER_DIR ${MAGNUM_PLUGINS_DIR}/imageconverters) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e681f3e2..85bc050e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -199,6 +199,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h DESTINATION ${MAGNUM add_subdirectory(Math) add_subdirectory(Platform) +add_subdirectory(Plugins) add_subdirectory(Trade) if(WITH_AUDIO) diff --git a/src/Plugins/CMakeLists.txt b/src/Plugins/CMakeLists.txt new file mode 100644 index 000000000..f7324492d --- /dev/null +++ b/src/Plugins/CMakeLists.txt @@ -0,0 +1,54 @@ +# +# This file is part of Magnum. +# +# Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš +# +# 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. +# + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +# Wrapper for creating given plugin type +macro(add_plugin) + if(NOT BUILD_STATIC) + corrade_add_plugin(${ARGN}) + else() + corrade_add_static_plugin(${ARGN}) + endif() +endmacro() + +if(WITH_TEXT AND WITH_MAGNUMFONT) + add_subdirectory(MagnumFont) +endif() + +if(WITH_TEXT AND WITH_MAGNUMFONTCONVERTER AND NOT MAGNUM_TARGET_GLES) + add_subdirectory(MagnumFontConverter) +endif() + +if(WITH_TGAIMAGECONVERTER) + add_subdirectory(TgaImageConverter) +endif() + +if(WITH_TGAIMPORTER) + add_subdirectory(TgaImporter) +endif() + +if(WITH_AUDIO AND WITH_WAVAUDIOIMPORTER) + add_subdirectory(WavAudioImporter) +endif() diff --git a/src/Plugins/MagnumFont/CMakeLists.txt b/src/Plugins/MagnumFont/CMakeLists.txt index 11d09f8e5..9ea4bb7a8 100644 --- a/src/Plugins/MagnumFont/CMakeLists.txt +++ b/src/Plugins/MagnumFont/CMakeLists.txt @@ -22,8 +22,6 @@ # DEALINGS IN THE SOFTWARE. # -find_package(Magnum REQUIRED Text) - set(MagnumFont_SOURCES MagnumFont.cpp) @@ -37,9 +35,7 @@ add_plugin(MagnumFont ${MAGNUM_PLUGINS_FONT_INSTALL_DIR} MagnumFont.conf $ pluginRegistrationMagnumFont.cpp) -target_link_libraries(MagnumFont - ${MAGNUM_LIBRARIES} - ${MAGNUM_TEXT_LIBRARIES}) +target_link_libraries(MagnumFont Magnum MagnumText) if(WIN32) target_link_libraries(MagnumFont TgaImporter) @@ -49,10 +45,6 @@ install(FILES ${MagnumFont_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL if(BUILD_GL_TESTS) add_library(MagnumFontTestLib STATIC $) - target_link_libraries(MagnumFontTestLib - ${MAGNUM_LIBRARIES} - ${MAGNUM_TEXT_LIBRARIES} - TgaImporterTestLib) - + target_link_libraries(MagnumFontTestLib Magnum MagnumText TgaImporterTestLib) add_subdirectory(Test) endif() diff --git a/src/Plugins/MagnumFont/MagnumFont.h b/src/Plugins/MagnumFont/MagnumFont.h index 18690b750..13c6723e2 100644 --- a/src/Plugins/MagnumFont/MagnumFont.h +++ b/src/Plugins/MagnumFont/MagnumFont.h @@ -40,9 +40,8 @@ This plugin depends on @ref Trade::TgaImporter "TgaImporter" plugin and is built if `WITH_MAGNUMFONT` is enabled in CMake. To use dynamic plugin, you need to load `%MagnumFont` plugin from `fonts/` subdirectory of your plugin dir. To use static plugin or use this as a dependency of another plugin, you need to -request `%MagnumFont` component in CMake and link to -`${MAGNUMPLUGINS_MAGNUMFONT_LIBRARIES}`. See @ref building-plugins and -@ref cmake-plugins for more information. +request `%MagnumFont` component in CMake and link to `${MAGNUM_MAGNUMFONT_LIBRARIES}`. +See @ref building and @ref cmake for more information. The font consists of two files, one text file containing character and glyph info and one TGA file containing the glyphs in distance field format. The font diff --git a/src/Plugins/MagnumFontConverter/CMakeLists.txt b/src/Plugins/MagnumFontConverter/CMakeLists.txt index 71efa0c47..f73442afb 100644 --- a/src/Plugins/MagnumFontConverter/CMakeLists.txt +++ b/src/Plugins/MagnumFontConverter/CMakeLists.txt @@ -22,8 +22,6 @@ # DEALINGS IN THE SOFTWARE. # -find_package(Magnum REQUIRED Text) - set(MagnumFontConverter_SOURCES MagnumFontConverter.cpp) @@ -37,9 +35,7 @@ add_plugin(MagnumFontConverter ${MAGNUM_PLUGINS_FONTCONVERTER_INSTALL_DIR} MagnumFontConverter.conf $ pluginRegistrationMagnumFontConverter.cpp) -target_link_libraries(MagnumFontConverter - ${MAGNUM_LIBRARIES} - ${MAGNUM_TEXT_LIBRARIES}) +target_link_libraries(MagnumFontConverter Magnum MagnumText) if(WIN32) target_link_libraries(MagnumFontConverter TgaImageConverter) @@ -49,9 +45,6 @@ install(FILES ${MagnumFontConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUD if(BUILD_GL_TESTS) add_library(MagnumFontConverterTestLib STATIC $) - target_link_libraries(MagnumFontConverterTestLib - ${MAGNUM_LIBRARIES} - ${MAGNUM_TEXT_LIBRARIES} - TgaImageConverterTestLib) + target_link_libraries(MagnumFontConverterTestLib Magnum MagnumText TgaImageConverterTestLib) add_subdirectory(Test) endif() diff --git a/src/Plugins/MagnumFontConverter/MagnumFontConverter.h b/src/Plugins/MagnumFontConverter/MagnumFontConverter.h index 8c363f84b..fc725b36f 100644 --- a/src/Plugins/MagnumFontConverter/MagnumFontConverter.h +++ b/src/Plugins/MagnumFontConverter/MagnumFontConverter.h @@ -45,8 +45,8 @@ to read back the generated data. It depends on to load `%MagnumFontConverter` plugin from `fontconverters/` subdirectory of your plugin dir. To use static plugin or use this as a dependency of another plugin, you need to request `%MagnumFontConverter` component in CMake and link -to `${MAGNUMPLUGINS_MAGNUMFONTCONVERTER_LIBRARIES}`. See @ref building-plugins -and @ref cmake-plugins for more information. +to `${MAGNUM_MAGNUMFONTCONVERTER_LIBRARIES}`. See @ref building and @ref cmake +for more information. */ class MagnumFontConverter: public Text::AbstractFontConverter { public: diff --git a/src/Plugins/TgaImageConverter/CMakeLists.txt b/src/Plugins/TgaImageConverter/CMakeLists.txt index f72e90679..1ef44c77a 100644 --- a/src/Plugins/TgaImageConverter/CMakeLists.txt +++ b/src/Plugins/TgaImageConverter/CMakeLists.txt @@ -35,12 +35,12 @@ add_plugin(TgaImageConverter ${MAGNUM_PLUGINS_IMAGECONVERTER_INSTALL_DIR} TgaImageConverter.conf $ pluginRegistrationTgaImageConverter.cpp) -target_link_libraries(TgaImageConverter ${MAGNUM_LIBRARIES}) +target_link_libraries(TgaImageConverter Magnum) install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter) if(BUILD_TESTS) add_library(TgaImageConverterTestLib SHARED $) - target_link_libraries(TgaImageConverterTestLib ${MAGNUM_LIBRARIES}) + target_link_libraries(TgaImageConverterTestLib Magnum) add_subdirectory(Test) endif() diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.h b/src/Plugins/TgaImageConverter/TgaImageConverter.h index face4c643..01b8f6bc8 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.h +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.h @@ -51,8 +51,8 @@ This plugin is built if `WITH_TGAIMAGECONVERTER` is enabled in CMake. To use dynamic plugin, you need to load `%TgaImageConverter` plugin from `imageconverters/` subdirectory of your plugin dir. To use static plugin or use this as a dependency of another plugin, you need to request `%TgaImageConverter` -component in CMake and link to `${MAGNUMPLUGINS_TGAIMAGECONVERTER_LIBRARIES}`. -See @ref building-plugins and @ref cmake-plugins for more information. +component in CMake and link to `${MAGNUM_TGAIMAGECONVERTER_LIBRARIES}`. See +@ref building and @ref cmake for more information. */ class MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT TgaImageConverter: public AbstractImageConverter { public: diff --git a/src/Plugins/TgaImporter/CMakeLists.txt b/src/Plugins/TgaImporter/CMakeLists.txt index 90b63a1ea..a979859f3 100644 --- a/src/Plugins/TgaImporter/CMakeLists.txt +++ b/src/Plugins/TgaImporter/CMakeLists.txt @@ -36,12 +36,12 @@ add_plugin(TgaImporter ${MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR} TgaImporter.conf $ pluginRegistrationTgaImporter.cpp) -target_link_libraries(TgaImporter ${MAGNUM_LIBRARIES}) +target_link_libraries(TgaImporter Magnum) install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter) if(BUILD_TESTS) add_library(TgaImporterTestLib SHARED $) - target_link_libraries(TgaImporterTestLib ${MAGNUM_LIBRARIES}) + target_link_libraries(TgaImporterTestLib Magnum) add_subdirectory(Test) endif() diff --git a/src/Plugins/TgaImporter/TgaImporter.h b/src/Plugins/TgaImporter/TgaImporter.h index 95deeeebb..3a5e2c497 100644 --- a/src/Plugins/TgaImporter/TgaImporter.h +++ b/src/Plugins/TgaImporter/TgaImporter.h @@ -51,8 +51,8 @@ This plugin is built if `WITH_TGAIMPORTER` is enabled in CMake. To use dynamic plugin, you need to load `%TgaImporter` plugin from `importers/` subdirectory of your plugin dir. To use static plugin or use this as a dependency of another plugin, you need to request `%TgaImporter` component in CMake and link to -`${MAGNUMPLUGINS_TGAIMPORTER_LIBRARIES}`. See @ref building-plugins and -@ref cmake-plugins for more information. +`${MAGNUM_TGAIMPORTER_LIBRARIES}`. See @ref building and @ref cmake for more +information. The images are imported with @ref ColorType::UnsignedByte and @ref ColorFormat::BGR, @ref ColorFormat::BGRA or @ref ColorFormat::Red, respectively. Grayscale images diff --git a/src/Plugins/WavAudioImporter/CMakeLists.txt b/src/Plugins/WavAudioImporter/CMakeLists.txt index 71bce608f..4f25d3ab6 100644 --- a/src/Plugins/WavAudioImporter/CMakeLists.txt +++ b/src/Plugins/WavAudioImporter/CMakeLists.txt @@ -22,9 +22,7 @@ # DEALINGS IN THE SOFTWARE. # -find_package(Magnum REQUIRED Audio) - -include_directories(${MAGNUM_AUDIO_INCLUDE_DIRS}) +include_directories(${OPENAL_INCLUDE_DIR}) set(WavAudioImporter_SRCS WavImporter.cpp) @@ -40,12 +38,12 @@ add_plugin(WavAudioImporter ${MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR} WavAudioImporter.conf $ pluginRegistrationWavAudioImporter.cpp) -target_link_libraries(WavAudioImporter ${MAGNUM_LIBRARIES} ${MAGNUM_AUDIO_LIBRARIES}) +target_link_libraries(WavAudioImporter Magnum MagnumAudio) install(FILES ${WavAudioImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/WavAudioImporter) if(BUILD_TESTS) add_library(WavAudioImporterTestLib STATIC $) - target_link_libraries(WavAudioImporterTestLib ${MAGNUM_LIBRARIES} ${MAGNUM_AUDIO_LIBRARIES}) + target_link_libraries(WavAudioImporterTestLib Magnum MagnumAudio) add_subdirectory(Test) endif() diff --git a/src/Plugins/WavAudioImporter/WavImporter.h b/src/Plugins/WavAudioImporter/WavImporter.h index fe7f8010e..1bcbd7319 100644 --- a/src/Plugins/WavAudioImporter/WavImporter.h +++ b/src/Plugins/WavAudioImporter/WavImporter.h @@ -45,8 +45,8 @@ This plugin is built if `WITH_WAVAUDIOIMPORTER` is enabled in CMake. To use dynamic plugin, you need to load `%WavAudioImporter` plugin from `audioimporters/` subdirectory of your plugin dir. To use static plugin or or use this as a dependency of another plugin, you need to request `%WavAudioImporter` component -in CMake and link to `${MAGNUMPLUGINS_WAVAUDIOIMPORTER_LIBRARIES}`. See -@ref building-plugins and @ref cmake-plugins for more information. +in CMake and link to `${MAGNUM_WAVAUDIOIMPORTER_LIBRARIES}`. See @ref building +and @ref cmake for more information. */ class WavImporter: public AbstractImporter { public: From 08c4802bd2cb1eedac6c0845a2b0fbcbd19d3e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Oct 2013 14:44:28 +0100 Subject: [PATCH 03/56] Plugins: skip the unimplemented test case instead of failing whole test. It is better to run automatically all tests than to manually check that only this one error is present. --- src/Plugins/MagnumFont/Test/MagnumFontTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp b/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp index 35b130f8e..f1d14394e 100644 --- a/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp +++ b/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp @@ -98,6 +98,7 @@ void MagnumFontTest::layout() { void MagnumFontTest::createGlyphCache() { /** @todo */ + CORRADE_SKIP("Not yet implemented"); } }}} From 9c356d052c7eda264d4f89da91ea34bf39023f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Oct 2013 15:17:02 +0100 Subject: [PATCH 04/56] Plugins: remove the need for FreeTypeFont in MagnumFontConverter test. --- .../MagnumFontConverter/Test/CMakeLists.txt | 4 +- .../Test/MagnumFontConverterTest.cpp | 44 +++++++++++++------ 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/Plugins/MagnumFontConverter/Test/CMakeLists.txt b/src/Plugins/MagnumFontConverter/Test/CMakeLists.txt index a6b28e93e..91b3d9470 100644 --- a/src/Plugins/MagnumFontConverter/Test/CMakeLists.txt +++ b/src/Plugins/MagnumFontConverter/Test/CMakeLists.txt @@ -25,12 +25,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumFontConverterTestConfigure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/magnumFontConverterTestConfigure.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../FreeTypeFont/Test/ - ${CMAKE_CURRENT_BINARY_DIR}/../../MagnumFont/Test/ +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../MagnumFont/Test/ ${CMAKE_CURRENT_BINARY_DIR}) corrade_add_test(MagnumFontConverterTest MagnumFontConverterTest.cpp LIBRARIES MagnumFontConverterTestLib - FreeTypeFontTestLib TgaImporterTestLib ${GL_TEST_LIBRARIES}) diff --git a/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp b/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp index 9e00c415c..d75fbb48a 100644 --- a/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp +++ b/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp @@ -31,11 +31,10 @@ #include #include -#include "FreeTypeFont/FreeTypeFont.h" +#include "Text/AbstractFont.h" #include "MagnumFontConverter/MagnumFontConverter.h" #include "TgaImporter/TgaImporter.h" -#include "freeTypeFontTestConfigure.h" #include "magnumFontTestConfigure.h" #include "magnumFontConverterTestConfigure.h" @@ -45,19 +44,11 @@ class MagnumFontConverterTest: public Magnum::Test::AbstractOpenGLTester { public: explicit MagnumFontConverterTest(); - ~MagnumFontConverterTest(); - void exportFont(); }; MagnumFontConverterTest::MagnumFontConverterTest() { addTests({&MagnumFontConverterTest::exportFont}); - - FreeTypeFont::initialize(); -} - -MagnumFontConverterTest::~MagnumFontConverterTest() { - FreeTypeFont::finalize(); } void MagnumFontConverterTest::exportFont() { @@ -65,9 +56,36 @@ void MagnumFontConverterTest::exportFont() { Utility::Directory::rm(Utility::Directory::join(MAGNUMFONTCONVERTER_TEST_WRITE_DIR, "font.conf")); Utility::Directory::rm(Utility::Directory::join(MAGNUMFONTCONVERTER_TEST_WRITE_DIR, "font.tga")); - /* Open font */ - FreeTypeFont font; - CORRADE_VERIFY(font.openFile(Utility::Directory::join(FREETYPEFONT_TEST_DIR, "Oxygen.ttf"), 16.0f)); + /* Fake font with fake cache */ + class FakeFont: public Text::AbstractFont { + public: + explicit FakeFont() { _size = 16.0f; } + + private: + void doClose() {} + bool doIsOpened() const { return true; } + Features doFeatures() const { return {}; } + AbstractLayouter* doLayout(const GlyphCache&, Float, const std::string&) { return nullptr; } + + UnsignedInt doGlyphId(const char32_t character) { + switch(character) { + case 'W': return 2; + case 'e': return 1; + } + + return 0; + } + + Vector2 doGlyphAdvance(const UnsignedInt glyph) { + switch(glyph) { + case 0: return {8, 0}; + case 1: return {12, 0}; + case 2: return {23, 0}; + } + + CORRADE_ASSERT_UNREACHABLE(); + } + } font; /* Create fake cache */ MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::texture_rg); From 847f2b429f5be66bcdbcdb09cfd9cccddae5e1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Oct 2013 14:46:12 +0100 Subject: [PATCH 05/56] Build all the plugins in development PKGBUILDs. --- PKGBUILD | 5 +++++ PKGBUILD-emscripten | 6 +++++- PKGBUILD-es2 | 6 +++++- PKGBUILD-es2desktop | 6 +++++- PKGBUILD-es3 | 6 +++++- PKGBUILD-mingw32 | 7 ++++++- PKGBUILD-nacl-glibc | 12 +++++++++++- PKGBUILD-nacl-newlib | 12 +++++++++++- PKGBUILD-release | 7 ++++++- 9 files changed, 59 insertions(+), 8 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index c04bc16ee..9e1cdf500 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -30,6 +30,11 @@ build() { -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON \ -DBUILD_TESTS=TRUE \ -G Ninja ninja diff --git a/PKGBUILD-emscripten b/PKGBUILD-emscripten index f80ca8080..9875aa68f 100644 --- a/PKGBUILD-emscripten +++ b/PKGBUILD-emscripten @@ -27,7 +27,11 @@ build() { -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/emscripten/system \ -DWITH_AUDIO=OFF \ - -DWITH_SDL2APPLICATION=ON + -DWITH_SDL2APPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON make } diff --git a/PKGBUILD-es2 b/PKGBUILD-es2 index 79dddbd32..4ee6ac694 100644 --- a/PKGBUILD-es2 +++ b/PKGBUILD-es2 @@ -27,7 +27,11 @@ build() { -DTARGET_GLES=ON \ -DTARGET_GLES2=ON \ -DWITH_MAGNUMINFO=OFF \ - -DWITH_XEGLAPPLICATION=ON + -DWITH_XEGLAPPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON make } diff --git a/PKGBUILD-es2desktop b/PKGBUILD-es2desktop index 9b6eda6fc..8fab0570f 100644 --- a/PKGBUILD-es2desktop +++ b/PKGBUILD-es2desktop @@ -29,7 +29,11 @@ build() { -DTARGET_DESKTOP_GLES=ON \ -DWITH_MAGNUMINFO=ON \ -DWITH_GLXAPPLICATION=ON \ - -DWITH_WINDOWLESSGLXAPPLICATION=ON + -DWITH_WINDOWLESSGLXAPPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON make } diff --git a/PKGBUILD-es3 b/PKGBUILD-es3 index d9297b4c7..6696ba61e 100644 --- a/PKGBUILD-es3 +++ b/PKGBUILD-es3 @@ -27,7 +27,11 @@ build() { -DTARGET_GLES=ON \ -DTARGET_GLES2=OFF \ -DWITH_MAGNUMINFO=OFF \ - -DWITH_XEGLAPPLICATION=ON + -DWITH_XEGLAPPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON make } diff --git a/PKGBUILD-mingw32 b/PKGBUILD-mingw32 index 460c6f938..367beefe8 100644 --- a/PKGBUILD-mingw32 +++ b/PKGBUILD-mingw32 @@ -20,7 +20,12 @@ build() { -DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw32.cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/i486-mingw32 \ - -DWITH_GLUTAPPLICATION=ON + -DWITH_GLUTAPPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON make } diff --git a/PKGBUILD-nacl-glibc b/PKGBUILD-nacl-glibc index 05fd46e88..775a6ab11 100644 --- a/PKGBUILD-nacl-glibc +++ b/PKGBUILD-nacl-glibc @@ -22,6 +22,11 @@ build() { -DCMAKE_INSTALL_PREFIX=/usr/nacl \ -DWITH_MAGNUMINFO=OFF \ -DWITH_NACLAPPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON \ -DLIB_SUFFIX=/32 make @@ -35,7 +40,12 @@ build() { -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ -DWITH_MAGNUMINFO=OFF \ - -DWITH_NACLAPPLICATION=ON + -DWITH_NACLAPPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON make } diff --git a/PKGBUILD-nacl-newlib b/PKGBUILD-nacl-newlib index 35b96cf8d..06c478f19 100644 --- a/PKGBUILD-nacl-newlib +++ b/PKGBUILD-nacl-newlib @@ -24,6 +24,11 @@ build() { -DWITH_MAGNUMINFO=ON \ -DWITH_NACLAPPLICATION=ON \ -DWITH_WINDOWLESSNACLAPPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON \ -DLIB_SUFFIX=/32 make @@ -39,7 +44,12 @@ build() { -DWITH_AUDIO=OFF \ -DWITH_MAGNUMINFO=ON \ -DWITH_NACLAPPLICATION=ON \ - -DWITH_WINDOWLESSNACLAPPLICATION=ON + -DWITH_WINDOWLESSNACLAPPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON make } diff --git a/PKGBUILD-release b/PKGBUILD-release index 8d46bfea6..c104426d6 100644 --- a/PKGBUILD-release +++ b/PKGBUILD-release @@ -24,7 +24,12 @@ build() { -DCMAKE_INSTALL_PREFIX=/usr \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ - -DWITH_SDL2APPLICATION=ON + -DWITH_SDL2APPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON \ -DBUILD_TESTS=TRUE make } From b3d1bd1f9b15f7f80ed7827a910152c5df731384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Oct 2013 16:48:37 +0100 Subject: [PATCH 06/56] Plugins: fixed ES build of TgaImageConverter. --- src/Plugins/TgaImageConverter/TgaImageConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp index e273226ae..976263821 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp @@ -81,7 +81,7 @@ Containers::Array TgaImageConverter::doExportToData(const ImageRe std::copy(image.data(), image.data()+pixelSize*image.size().product(), data.begin()+sizeof(TgaHeader)); #ifdef MAGNUM_TARGET_GLES - if(image->format() == ColorFormat::RGB) { + if(image.format() == ColorFormat::RGB) { auto pixels = reinterpret_cast*>(data.begin()+sizeof(TgaHeader)); std::transform(pixels, pixels + image.size().product(), pixels, [](Math::Vector3 pixel) { return swizzle<'b', 'g', 'r'>(pixel); }); From f29ea2140f934ca3fcb9dede0c19f38fa6551dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Oct 2013 17:01:53 +0100 Subject: [PATCH 07/56] Fixed ES build without deprecated API. --- src/Plugins/TgaImageConverter/TgaImageConverter.cpp | 7 ++++--- src/Plugins/TgaImporter/TgaImporter.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp index 976263821..f5b6ddc08 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp @@ -33,7 +33,8 @@ #ifdef MAGNUM_TARGET_GLES #include -#include +#include "Math/Swizzle.h" +#include "Math/Vector4.h" #endif #include "TgaImporter/TgaHeader.h" @@ -84,11 +85,11 @@ Containers::Array TgaImageConverter::doExportToData(const ImageRe if(image.format() == ColorFormat::RGB) { auto pixels = reinterpret_cast*>(data.begin()+sizeof(TgaHeader)); std::transform(pixels, pixels + image.size().product(), pixels, - [](Math::Vector3 pixel) { return swizzle<'b', 'g', 'r'>(pixel); }); + [](Math::Vector3 pixel) { return Math::swizzle<'b', 'g', 'r'>(pixel); }); } else if(image.format() == ColorFormat::RGBA) { auto pixels = reinterpret_cast*>(data.begin()+sizeof(TgaHeader)); std::transform(pixels, pixels + image.size().product(), pixels, - [](Math::Vector4 pixel) { return swizzle<'b', 'g', 'r', 'a'>(pixel); }); + [](Math::Vector4 pixel) { return Math::swizzle<'b', 'g', 'r', 'a'>(pixel); }); } #endif diff --git a/src/Plugins/TgaImporter/TgaImporter.cpp b/src/Plugins/TgaImporter/TgaImporter.cpp index 5e6867c4e..731610160 100644 --- a/src/Plugins/TgaImporter/TgaImporter.cpp +++ b/src/Plugins/TgaImporter/TgaImporter.cpp @@ -33,9 +33,10 @@ #ifdef MAGNUM_TARGET_GLES #include +#include "Math/Swizzle.h" +#include "Math/Vector4.h" #include #include -#include #endif #include "TgaHeader.h" @@ -146,11 +147,11 @@ std::optional TgaImporter::doImage2D(UnsignedInt) { if(format == ColorFormat::RGB) { auto pixels = reinterpret_cast*>(data); std::transform(pixels, pixels + size.product(), pixels, - [](Math::Vector3 pixel) { return swizzle<'b', 'g', 'r'>(pixel); }); + [](Math::Vector3 pixel) { return Math::swizzle<'b', 'g', 'r'>(pixel); }); } else if(format == ColorFormat::RGBA) { auto pixels = reinterpret_cast*>(data); std::transform(pixels, pixels + size.product(), pixels, - [](Math::Vector4 pixel) { return swizzle<'b', 'g', 'r', 'a'>(pixel); }); + [](Math::Vector4 pixel) { return Math::swizzle<'b', 'g', 'r', 'a'>(pixel); }); } #endif From c9ad94713642a46d0ea562e2a7aab671eb8041a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Oct 2013 17:02:16 +0100 Subject: [PATCH 08/56] Plugins: mark the includes as inter-project, not external. --- src/Plugins/MagnumFont/MagnumFont.cpp | 10 +++++----- src/Plugins/MagnumFont/MagnumFont.h | 4 ++-- src/Plugins/MagnumFont/Test/MagnumFontTest.cpp | 4 ++-- .../MagnumFontConverter/MagnumFontConverter.cpp | 11 ++++++----- .../MagnumFontConverter/MagnumFontConverter.h | 2 +- .../Test/MagnumFontConverterTest.cpp | 13 +++++++------ .../Test/TgaImageConverterTest.cpp | 11 ++++++----- src/Plugins/TgaImageConverter/TgaImageConverter.cpp | 9 +++++---- src/Plugins/TgaImageConverter/TgaImageConverter.h | 2 +- src/Plugins/TgaImporter/Test/TgaImporterTest.cpp | 4 ++-- src/Plugins/TgaImporter/TgaImporter.cpp | 9 +++++---- src/Plugins/WavAudioImporter/WavHeader.h | 2 +- src/Plugins/WavAudioImporter/WavImporter.h | 3 ++- 13 files changed, 45 insertions(+), 39 deletions(-) diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index 8fdbeedf9..21a639978 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -25,11 +25,11 @@ #include "MagnumFont.h" #include -#include -#include -#include -#include -#include +#include "Containers/Array.h" +#include "Utility/Directory.h" +#include "Utility/Unicode.h" +#include "Text/GlyphCache.h" +#include "Trade/ImageData.h" #include "TgaImporter/TgaImporter.h" diff --git a/src/Plugins/MagnumFont/MagnumFont.h b/src/Plugins/MagnumFont/MagnumFont.h index 13c6723e2..925568a07 100644 --- a/src/Plugins/MagnumFont/MagnumFont.h +++ b/src/Plugins/MagnumFont/MagnumFont.h @@ -28,8 +28,8 @@ * @brief Class Magnum::Text::MagnumFont */ -#include -#include +#include "Text/AbstractFont.h" +#include "Trade/Trade.h" namespace Magnum { namespace Text { diff --git a/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp b/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp index f1d14394e..aecb00a8e 100644 --- a/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp +++ b/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp @@ -22,10 +22,10 @@ DEALINGS IN THE SOFTWARE. */ -#include -#include #include +#include "Test/AbstractOpenGLTester.h" +#include "Text/GlyphCache.h" #include "MagnumFont/MagnumFont.h" #include "magnumFontTestConfigure.h" diff --git a/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp index 0e841fca3..b7ac51cfc 100644 --- a/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -27,11 +27,12 @@ #include #include #include -#include -#include -#include -#include -#include + +#include "ColorFormat.h" +#include "Image.h" +#include "Text/GlyphCache.h" +#include "Text/AbstractFont.h" +#include "TgaImageConverter/TgaImageConverter.h" namespace Magnum { namespace Text { diff --git a/src/Plugins/MagnumFontConverter/MagnumFontConverter.h b/src/Plugins/MagnumFontConverter/MagnumFontConverter.h index fc725b36f..ff23c414b 100644 --- a/src/Plugins/MagnumFontConverter/MagnumFontConverter.h +++ b/src/Plugins/MagnumFontConverter/MagnumFontConverter.h @@ -28,7 +28,7 @@ * @brief Class Magnum::Text::MagnumFontConverter */ -#include +#include "Text/AbstractFontConverter.h" namespace Magnum { namespace Text { diff --git a/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp b/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp index d75fbb48a..d4c6dcce6 100644 --- a/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp +++ b/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp @@ -24,12 +24,13 @@ #include #include -#include -#include -#include -#include -#include -#include + +#include "ColorFormat.h" +#include "Extensions.h" +#include "TextureFormat.h" +#include "Test/AbstractOpenGLTester.h" +#include "Text/GlyphCache.h" +#include "Trade/ImageData.h" #include "Text/AbstractFont.h" #include "MagnumFontConverter/MagnumFontConverter.h" diff --git a/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index 20e1a5c77..3688a6dcd 100644 --- a/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -27,11 +27,12 @@ #include #include #include -#include -#include -#include -#include -#include + +#include "ColorFormat.h" +#include "Image.h" +#include "Trade/ImageData.h" +#include "TgaImageConverter/TgaImageConverter.h" +#include "TgaImporter/TgaImporter.h" #include "configure.h" diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp index f5b6ddc08..fdb9c8c11 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp @@ -26,10 +26,11 @@ #include #include -#include -#include -#include -#include + +#include "Containers/Array.h" +#include "Utility/Endianness.h" +#include "ColorFormat.h" +#include "Image.h" #ifdef MAGNUM_TARGET_GLES #include diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.h b/src/Plugins/TgaImageConverter/TgaImageConverter.h index 01b8f6bc8..7acaa4dfd 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.h +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.h @@ -28,7 +28,7 @@ * @brief Class Magnum::Trade::TgaImageConverter */ -#include +#include "Trade/AbstractImageConverter.h" #ifndef DOXYGEN_GENERATING_OUTPUT #if defined(TgaImageConverter_EXPORTS) || defined(TgaImageConverterObjects_EXPORTS) diff --git a/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp b/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp index 7f08d8c62..d371e55d3 100644 --- a/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp @@ -26,9 +26,9 @@ #include #include #include -#include -#include +#include "ColorFormat.h" +#include "Trade/ImageData.h" #include "TgaImporter/TgaImporter.h" #include "configure.h" diff --git a/src/Plugins/TgaImporter/TgaImporter.cpp b/src/Plugins/TgaImporter/TgaImporter.cpp index 731610160..471e3d652 100644 --- a/src/Plugins/TgaImporter/TgaImporter.cpp +++ b/src/Plugins/TgaImporter/TgaImporter.cpp @@ -28,15 +28,16 @@ #include #include #include -#include -#include + +#include "ColorFormat.h" +#include "Trade/ImageData.h" #ifdef MAGNUM_TARGET_GLES #include #include "Math/Swizzle.h" #include "Math/Vector4.h" -#include -#include +#include "Context.h" +#include "Extensions.h" #endif #include "TgaHeader.h" diff --git a/src/Plugins/WavAudioImporter/WavHeader.h b/src/Plugins/WavAudioImporter/WavHeader.h index e472b8f5f..32779d21c 100644 --- a/src/Plugins/WavAudioImporter/WavHeader.h +++ b/src/Plugins/WavAudioImporter/WavHeader.h @@ -28,7 +28,7 @@ * @brief Struct Magnum::Audio::WavHeader */ -#include +#include "Types.h" namespace Magnum { namespace Audio { diff --git a/src/Plugins/WavAudioImporter/WavImporter.h b/src/Plugins/WavAudioImporter/WavImporter.h index 1bcbd7319..12fae4634 100644 --- a/src/Plugins/WavAudioImporter/WavImporter.h +++ b/src/Plugins/WavAudioImporter/WavImporter.h @@ -30,7 +30,8 @@ #include #include -#include