Browse Source

Integrated plugins into build system and updated the documentation.

pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
3fb969d397
  1. 14
      CMakeLists.txt
  2. 23
      doc/building.dox
  3. 37
      doc/cmake.dox
  4. 107
      modules/FindMagnum.cmake
  5. 1
      src/CMakeLists.txt
  6. 54
      src/Plugins/CMakeLists.txt
  7. 12
      src/Plugins/MagnumFont/CMakeLists.txt
  8. 5
      src/Plugins/MagnumFont/MagnumFont.h
  9. 11
      src/Plugins/MagnumFontConverter/CMakeLists.txt
  10. 4
      src/Plugins/MagnumFontConverter/MagnumFontConverter.h
  11. 4
      src/Plugins/TgaImageConverter/CMakeLists.txt
  12. 4
      src/Plugins/TgaImageConverter/TgaImageConverter.h
  13. 4
      src/Plugins/TgaImporter/CMakeLists.txt
  14. 4
      src/Plugins/TgaImporter/TgaImporter.h
  15. 8
      src/Plugins/WavAudioImporter/CMakeLists.txt
  16. 4
      src/Plugins/WavAudioImporter/WavImporter.h

14
CMakeLists.txt

@ -63,6 +63,13 @@ else()
option(WITH_SDL2APPLICATION "Build Sdl2Application library" OFF) option(WITH_SDL2APPLICATION "Build Sdl2Application library" OFF)
endif() 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) option(BUILD_DEPRECATED "Include deprecated API in the build" ON)
if(BUILD_DEPRECATED) if(BUILD_DEPRECATED)
set(MAGNUM_BUILD_DEPRECATED 1) set(MAGNUM_BUILD_DEPRECATED 1)
@ -134,9 +141,16 @@ endif()
include(CorradeLibSuffix) include(CorradeLibSuffix)
set(MAGNUM_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin) set(MAGNUM_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin)
set(MAGNUM_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) 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_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/magnum)
set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules) set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules)
set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum) 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(external)
add_subdirectory(modules) add_subdirectory(modules)

23
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. See also @ref corrade-cmake and @ref src/Corrade.h for additional
information. information.
By default the engine is built with nearly everything except Audio library and By default the engine is built with nearly everything except Audio library,
application libraries (see below). Using `WITH_*` CMake parameters you can plugins and application libraries (see below). Using `WITH_*` CMake parameters
specify which parts will be built and which not: you can specify which parts will be built and which not:
- `WITH_AUDIO` - Audio library. Depends on **OpenAL** library, not built by - `WITH_AUDIO` - Audio library. Depends on **OpenAL** library, not built by
default. default.
@ -175,6 +175,23 @@ platform best:
- `WITH_WINDOWLESSGLXAPPLICATION` - @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" - `WITH_WINDOWLESSGLXAPPLICATION` - @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication"
- `WITH_WINDOWLESSNACLAPPLICATION` - @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" - `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 Note that [each namespace](namespaces.html) and all @ref Platform libraries
contain more detailed information about dependencies, availability on contain more detailed information about dependencies, availability on
particular platform and also guide how to enable given library in build and use particular platform and also guide how to enable given library in build and use

37
doc/cmake.dox

@ -43,8 +43,17 @@ variables:
- `MAGNUM_FOUND` -- Whether the library was found - `MAGNUM_FOUND` -- Whether the library was found
- `MAGNUM_LIBRARIES` -- %Magnum library and dependent libraries - `MAGNUM_LIBRARIES` -- %Magnum library and dependent libraries
- `MAGNUM_INCLUDE_DIRS` -- Root include dir and include dirs of dependencies - `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_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_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 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 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" - `%WindowlessGlxApplication` -- @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication"
- `%WindowlessNaClApplication` -- @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" - `%WindowlessNaClApplication` -- @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication"
Note that [each namespace](namespaces.html) and all @ref Platform libraries The library also contains a set of plugins for importing essential file
contain more detailed information about dependencies, availability on formats. Additional plugins are provided in separate plugin repository, see
particular platform and also guide how to enable given library in build and use @ref cmake-plugins for more information. If you are going to use dynamic
it with CMake. 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: Example usage with specifying additional components is:

107
modules/FindMagnum.cmake

@ -7,6 +7,7 @@
# MAGNUM_LIBRARIES - Magnum library and dependent libraries # MAGNUM_LIBRARIES - Magnum library and dependent libraries
# MAGNUM_INCLUDE_DIRS - Root include dir and include dirs of # MAGNUM_INCLUDE_DIRS - Root include dir and include dirs of
# dependencies # dependencies
# MAGNUM_PLUGINS_INCLUDE_DIR - Include dir with plugins
# MAGNUM_PLUGINS_DIR - Base directory with plugins. You can modify # MAGNUM_PLUGINS_DIR - Base directory with plugins. You can modify
# it (e.g. set it to `.` when deploying on Windows with plugins stored # it (e.g. set it to `.` when deploying on Windows with plugins stored
# relatively to the executable), the following MAGNUM_PLUGINS_*_DIR # relatively to the executable), the following MAGNUM_PLUGINS_*_DIR
@ -30,6 +31,13 @@
# Shapes - Shapes library (depends on SceneGraph component) # Shapes - Shapes library (depends on SceneGraph component)
# Text - Text library (depends on TextureTools component) # Text - Text library (depends on TextureTools component)
# TextureTools - TextureTools library # 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 # GlutApplication - GLUT application
# GlxApplication - GLX application # GlxApplication - GLX application
# NaClApplication - NaCl application # NaClApplication - NaCl application
@ -167,15 +175,66 @@ endif()
foreach(component ${Magnum_FIND_COMPONENTS}) foreach(component ${Magnum_FIND_COMPONENTS})
string(TOUPPER ${component} _COMPONENT) string(TOUPPER ${component} _COMPONENT)
# Find the library # AudioImporter plugin specific name suffixes
find_library(MAGNUM_${_COMPONENT}_LIBRARY Magnum${component}) 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 # Applications
if(${component} MATCHES .+Application) if(${component} MATCHES .+Application)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Platform) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Platform)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${component}.h)
# GLUT application dependencies # GLUT application dependencies
if(${component} STREQUAL GlutApplication) if(${component} STREQUAL GlutApplication)
@ -223,12 +282,9 @@ foreach(component ${Magnum_FIND_COMPONENTS})
unset(MAGNUM_${_COMPONENT}_LIBRARY) unset(MAGNUM_${_COMPONENT}_LIBRARY)
endif() endif()
endif() endif()
endif()
# Audio library # Audio library
if(${component} STREQUAL Audio) elseif(${component} STREQUAL Audio)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Audio.h)
find_package(OpenAL) find_package(OpenAL)
if(OPENAL_FOUND) if(OPENAL_FOUND)
set(_MAGNUM_${_COMPONENT}_LIBRARIES ${OPENAL_LIBRARY}) set(_MAGNUM_${_COMPONENT}_LIBRARIES ${OPENAL_LIBRARY})
@ -236,45 +292,17 @@ foreach(component ${Magnum_FIND_COMPONENTS})
else() else()
unset(MAGNUM_${_COMPONENT}_LIBRARY) unset(MAGNUM_${_COMPONENT}_LIBRARY)
endif() endif()
endif()
# DebugTools library
if(${component} STREQUAL DebugTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES DebugTools.h)
endif()
# Mesh tools library # Mesh tools library
if(${component} STREQUAL MeshTools) elseif(${component} STREQUAL MeshTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h)
endif()
# Primitives library # Primitives library
if(${component} STREQUAL Primitives) elseif(${component} STREQUAL Primitives)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Cube.h) 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 # TextureTools library
if(${component} STREQUAL TextureTools) elseif(${component} STREQUAL TextureTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h)
endif() endif()
@ -367,6 +395,7 @@ set(MAGNUM_PLUGINS_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}
CACHE PATH "Base directory where to look for Magnum plugins") CACHE PATH "Base directory where to look for Magnum plugins")
# Plugin directories # Plugin directories
set(MAGNUM_PLUGINS_INCLUDE_DIR ${MAGNUM_INCLUDE_DIR}/Plugins)
set(MAGNUM_PLUGINS_FONT_DIR ${MAGNUM_PLUGINS_DIR}/fonts) set(MAGNUM_PLUGINS_FONT_DIR ${MAGNUM_PLUGINS_DIR}/fonts)
set(MAGNUM_PLUGINS_FONTCONVERTER_DIR ${MAGNUM_PLUGINS_DIR}/fontconverters) set(MAGNUM_PLUGINS_FONTCONVERTER_DIR ${MAGNUM_PLUGINS_DIR}/fontconverters)
set(MAGNUM_PLUGINS_IMAGECONVERTER_DIR ${MAGNUM_PLUGINS_DIR}/imageconverters) set(MAGNUM_PLUGINS_IMAGECONVERTER_DIR ${MAGNUM_PLUGINS_DIR}/imageconverters)

1
src/CMakeLists.txt

@ -199,6 +199,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h DESTINATION ${MAGNUM
add_subdirectory(Math) add_subdirectory(Math)
add_subdirectory(Platform) add_subdirectory(Platform)
add_subdirectory(Plugins)
add_subdirectory(Trade) add_subdirectory(Trade)
if(WITH_AUDIO) if(WITH_AUDIO)

54
src/Plugins/CMakeLists.txt

@ -0,0 +1,54 @@
#
# 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.
#
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()

12
src/Plugins/MagnumFont/CMakeLists.txt

@ -22,8 +22,6 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
find_package(Magnum REQUIRED Text)
set(MagnumFont_SOURCES set(MagnumFont_SOURCES
MagnumFont.cpp) MagnumFont.cpp)
@ -37,9 +35,7 @@ add_plugin(MagnumFont ${MAGNUM_PLUGINS_FONT_INSTALL_DIR}
MagnumFont.conf MagnumFont.conf
$<TARGET_OBJECTS:MagnumFontObjects> $<TARGET_OBJECTS:MagnumFontObjects>
pluginRegistrationMagnumFont.cpp) pluginRegistrationMagnumFont.cpp)
target_link_libraries(MagnumFont target_link_libraries(MagnumFont Magnum MagnumText)
${MAGNUM_LIBRARIES}
${MAGNUM_TEXT_LIBRARIES})
if(WIN32) if(WIN32)
target_link_libraries(MagnumFont TgaImporter) target_link_libraries(MagnumFont TgaImporter)
@ -49,10 +45,6 @@ install(FILES ${MagnumFont_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL
if(BUILD_GL_TESTS) if(BUILD_GL_TESTS)
add_library(MagnumFontTestLib STATIC $<TARGET_OBJECTS:MagnumFontObjects>) add_library(MagnumFontTestLib STATIC $<TARGET_OBJECTS:MagnumFontObjects>)
target_link_libraries(MagnumFontTestLib target_link_libraries(MagnumFontTestLib Magnum MagnumText TgaImporterTestLib)
${MAGNUM_LIBRARIES}
${MAGNUM_TEXT_LIBRARIES}
TgaImporterTestLib)
add_subdirectory(Test) add_subdirectory(Test)
endif() endif()

5
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 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 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 use static plugin or use this as a dependency of another plugin, you need to
request `%MagnumFont` component in CMake and link to request `%MagnumFont` component in CMake and link to `${MAGNUM_MAGNUMFONT_LIBRARIES}`.
`${MAGNUMPLUGINS_MAGNUMFONT_LIBRARIES}`. See @ref building-plugins and See @ref building and @ref cmake for more information.
@ref cmake-plugins for more information.
The font consists of two files, one text file containing character and glyph 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 info and one TGA file containing the glyphs in distance field format. The font

11
src/Plugins/MagnumFontConverter/CMakeLists.txt

@ -22,8 +22,6 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
find_package(Magnum REQUIRED Text)
set(MagnumFontConverter_SOURCES set(MagnumFontConverter_SOURCES
MagnumFontConverter.cpp) MagnumFontConverter.cpp)
@ -37,9 +35,7 @@ add_plugin(MagnumFontConverter ${MAGNUM_PLUGINS_FONTCONVERTER_INSTALL_DIR}
MagnumFontConverter.conf MagnumFontConverter.conf
$<TARGET_OBJECTS:MagnumFontConverterObjects> $<TARGET_OBJECTS:MagnumFontConverterObjects>
pluginRegistrationMagnumFontConverter.cpp) pluginRegistrationMagnumFontConverter.cpp)
target_link_libraries(MagnumFontConverter target_link_libraries(MagnumFontConverter Magnum MagnumText)
${MAGNUM_LIBRARIES}
${MAGNUM_TEXT_LIBRARIES})
if(WIN32) if(WIN32)
target_link_libraries(MagnumFontConverter TgaImageConverter) target_link_libraries(MagnumFontConverter TgaImageConverter)
@ -49,9 +45,6 @@ install(FILES ${MagnumFontConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUD
if(BUILD_GL_TESTS) if(BUILD_GL_TESTS)
add_library(MagnumFontConverterTestLib STATIC $<TARGET_OBJECTS:MagnumFontConverterObjects>) add_library(MagnumFontConverterTestLib STATIC $<TARGET_OBJECTS:MagnumFontConverterObjects>)
target_link_libraries(MagnumFontConverterTestLib target_link_libraries(MagnumFontConverterTestLib Magnum MagnumText TgaImageConverterTestLib)
${MAGNUM_LIBRARIES}
${MAGNUM_TEXT_LIBRARIES}
TgaImageConverterTestLib)
add_subdirectory(Test) add_subdirectory(Test)
endif() endif()

4
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 to load `%MagnumFontConverter` plugin from `fontconverters/` subdirectory of
your plugin dir. To use static plugin or use this as a dependency of another 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 plugin, you need to request `%MagnumFontConverter` component in CMake and link
to `${MAGNUMPLUGINS_MAGNUMFONTCONVERTER_LIBRARIES}`. See @ref building-plugins to `${MAGNUM_MAGNUMFONTCONVERTER_LIBRARIES}`. See @ref building and @ref cmake
and @ref cmake-plugins for more information. for more information.
*/ */
class MagnumFontConverter: public Text::AbstractFontConverter { class MagnumFontConverter: public Text::AbstractFontConverter {
public: public:

4
src/Plugins/TgaImageConverter/CMakeLists.txt

@ -35,12 +35,12 @@ add_plugin(TgaImageConverter ${MAGNUM_PLUGINS_IMAGECONVERTER_INSTALL_DIR}
TgaImageConverter.conf TgaImageConverter.conf
$<TARGET_OBJECTS:TgaImageConverterObjects> $<TARGET_OBJECTS:TgaImageConverterObjects>
pluginRegistrationTgaImageConverter.cpp) pluginRegistrationTgaImageConverter.cpp)
target_link_libraries(TgaImageConverter ${MAGNUM_LIBRARIES}) target_link_libraries(TgaImageConverter Magnum)
install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter) install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter)
if(BUILD_TESTS) if(BUILD_TESTS)
add_library(TgaImageConverterTestLib SHARED $<TARGET_OBJECTS:TgaImageConverterObjects>) add_library(TgaImageConverterTestLib SHARED $<TARGET_OBJECTS:TgaImageConverterObjects>)
target_link_libraries(TgaImageConverterTestLib ${MAGNUM_LIBRARIES}) target_link_libraries(TgaImageConverterTestLib Magnum)
add_subdirectory(Test) add_subdirectory(Test)
endif() endif()

4
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 dynamic plugin, you need to load `%TgaImageConverter` plugin from
`imageconverters/` subdirectory of your plugin dir. To use static plugin or use `imageconverters/` subdirectory of your plugin dir. To use static plugin or use
this as a dependency of another plugin, you need to request `%TgaImageConverter` this as a dependency of another plugin, you need to request `%TgaImageConverter`
component in CMake and link to `${MAGNUMPLUGINS_TGAIMAGECONVERTER_LIBRARIES}`. component in CMake and link to `${MAGNUM_TGAIMAGECONVERTER_LIBRARIES}`. See
See @ref building-plugins and @ref cmake-plugins for more information. @ref building and @ref cmake for more information.
*/ */
class MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT TgaImageConverter: public AbstractImageConverter { class MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT TgaImageConverter: public AbstractImageConverter {
public: public:

4
src/Plugins/TgaImporter/CMakeLists.txt

@ -36,12 +36,12 @@ add_plugin(TgaImporter ${MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR}
TgaImporter.conf TgaImporter.conf
$<TARGET_OBJECTS:TgaImporterObjects> $<TARGET_OBJECTS:TgaImporterObjects>
pluginRegistrationTgaImporter.cpp) pluginRegistrationTgaImporter.cpp)
target_link_libraries(TgaImporter ${MAGNUM_LIBRARIES}) target_link_libraries(TgaImporter Magnum)
install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter) install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter)
if(BUILD_TESTS) if(BUILD_TESTS)
add_library(TgaImporterTestLib SHARED $<TARGET_OBJECTS:TgaImporterObjects>) add_library(TgaImporterTestLib SHARED $<TARGET_OBJECTS:TgaImporterObjects>)
target_link_libraries(TgaImporterTestLib ${MAGNUM_LIBRARIES}) target_link_libraries(TgaImporterTestLib Magnum)
add_subdirectory(Test) add_subdirectory(Test)
endif() endif()

4
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 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 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 plugin, you need to request `%TgaImporter` component in CMake and link to
`${MAGNUMPLUGINS_TGAIMPORTER_LIBRARIES}`. See @ref building-plugins and `${MAGNUM_TGAIMPORTER_LIBRARIES}`. See @ref building and @ref cmake for more
@ref cmake-plugins for more information. information.
The images are imported with @ref ColorType::UnsignedByte and @ref ColorFormat::BGR, The images are imported with @ref ColorType::UnsignedByte and @ref ColorFormat::BGR,
@ref ColorFormat::BGRA or @ref ColorFormat::Red, respectively. Grayscale images @ref ColorFormat::BGRA or @ref ColorFormat::Red, respectively. Grayscale images

8
src/Plugins/WavAudioImporter/CMakeLists.txt

@ -22,9 +22,7 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
find_package(Magnum REQUIRED Audio) include_directories(${OPENAL_INCLUDE_DIR})
include_directories(${MAGNUM_AUDIO_INCLUDE_DIRS})
set(WavAudioImporter_SRCS set(WavAudioImporter_SRCS
WavImporter.cpp) WavImporter.cpp)
@ -40,12 +38,12 @@ add_plugin(WavAudioImporter ${MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR}
WavAudioImporter.conf WavAudioImporter.conf
$<TARGET_OBJECTS:WavAudioImporterObjects> $<TARGET_OBJECTS:WavAudioImporterObjects>
pluginRegistrationWavAudioImporter.cpp) 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) install(FILES ${WavAudioImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/WavAudioImporter)
if(BUILD_TESTS) if(BUILD_TESTS)
add_library(WavAudioImporterTestLib STATIC $<TARGET_OBJECTS:WavAudioImporterObjects>) add_library(WavAudioImporterTestLib STATIC $<TARGET_OBJECTS:WavAudioImporterObjects>)
target_link_libraries(WavAudioImporterTestLib ${MAGNUM_LIBRARIES} ${MAGNUM_AUDIO_LIBRARIES}) target_link_libraries(WavAudioImporterTestLib Magnum MagnumAudio)
add_subdirectory(Test) add_subdirectory(Test)
endif() endif()

4
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/` 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 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 dependency of another plugin, you need to request `%WavAudioImporter` component
in CMake and link to `${MAGNUMPLUGINS_WAVAUDIOIMPORTER_LIBRARIES}`. See in CMake and link to `${MAGNUM_WAVAUDIOIMPORTER_LIBRARIES}`. See @ref building
@ref building-plugins and @ref cmake-plugins for more information. and @ref cmake for more information.
*/ */
class WavImporter: public AbstractImporter { class WavImporter: public AbstractImporter {
public: public:

Loading…
Cancel
Save