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: