From 5101e3a60c1d9b4c8c584136a340fc97d7d8e69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 8 Apr 2014 16:10:23 +0200 Subject: [PATCH] Install also debug plugins to different location. Following changes done in Corrade. --- CMakeLists.txt | 18 ++- doc/building.dox | 12 +- doc/cmake.dox | 34 +++-- modules/FindMagnum.cmake | 122 ++++++++++++------ src/MagnumPlugins/CMakeLists.txt | 6 +- src/MagnumPlugins/MagnumFont/CMakeLists.txt | 2 +- .../MagnumFontConverter/CMakeLists.txt | 2 +- src/MagnumPlugins/ObjImporter/CMakeLists.txt | 2 +- .../TgaImageConverter/CMakeLists.txt | 2 +- src/MagnumPlugins/TgaImporter/CMakeLists.txt | 2 +- .../WavAudioImporter/CMakeLists.txt | 2 +- 11 files changed, 134 insertions(+), 70 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3416841d9..e73164561 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,12 +177,18 @@ 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_PLUGINS_DEBUG_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum-d) +set(MAGNUM_PLUGINS_RELEASE_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum) +set(MAGNUM_PLUGINS_FONT_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONT_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/fontconverters) +set(MAGNUM_PLUGINS_FONTCONVERTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/fontconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_IMPORTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/audioimporters) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_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) diff --git a/doc/building.dox b/doc/building.dox index 56c24d996..c513a58da 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -134,11 +134,13 @@ plan to use them with shared libraries later, enable also position-independent code with `BUILD_STATIC_PIC`. If you want to build with another compiler (e.g. Clang), pass `-DCMAKE_CXX_COMPILER=clang++` to CMake. -Libraries built in `Debug` configuration (e.g. with `CMAKE_BUILD_TYPE` set to -`Debug`) have `-d` suffix to make it possible to have both debug and release -libraries installed alongside each other. Headers and other files are the same -for both. The library distinction is handled automatically when using %Magnum -in depending projects, see @ref cmake for more information. +Libraries and static plugins built in `Debug` configuration (e.g. with +`CMAKE_BUILD_TYPE` set to `Debug`) have `-d` suffix to make it possible to have +both debug and release libraries installed alongside each other. *Dynamic* +plugins in `Debug` configuration are installed to `magnum-d` subdirectory +instead of `magnum`. Headers and other files are the same for both. The library +and plugin distinction is handled semi-automatically when using %Magnum in +depending projects, see @ref cmake for more information. %Magnum by default does not install `FindMagnum.cmake`, as you should bundle the module with your code instead of depending on it being in system location. diff --git a/doc/cmake.dox b/doc/cmake.dox index 81ea3723d..d5b7aa086 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -51,17 +51,19 @@ 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, defaults to `magnum/` - subdirectory of dir where Magnum library was found. 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_FONT_DIR` -- Directory with font plugins -- `MAGNUM_PLUGINS_FONTCONVERTER_DIR` -- Directory with font converter plugins -- `MAGNUM_PLUGINS_IMAGECONVERTER_DIR` -- Directory with image converter +- `MAGNUM_PLUGINS_DIR` -- Base directory with dynamic plugins, defaults to + `magnum/` subdirectory of dir where Magnum library was found (or + `magnum-d/` in debug build). . 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_FONT_DIR` -- Directory with dynamic font plugins +- `MAGNUM_PLUGINS_FONTCONVERTER_DIR` -- Directory with dynamic font converter + plugins +- `MAGNUM_PLUGINS_IMAGECONVERTER_DIR` -- Directory with dynamic image + converter plugins +- `MAGNUM_PLUGINS_IMPORTER_DIR` -- Directory with dynamic importer plugins +- `MAGNUM_PLUGINS_AUDIOIMPORTER_DIR` -- Directory with dynamic audio 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 components. The base library depends on %Corrade and OpenGL libraries (or @@ -133,9 +135,15 @@ convenience aliases `MAGNUM_APPLICATION_LIBRARIES` / / `MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS` to simplify porting. The package is found if either debug or release version of each requested -library is found. If both debug and release libraries are found, proper version -is chosen based on actual build configuration of the project (i.e. `Debug` -build is linked to debug libraries, `Release` build to release libraries). +library (or plugin) is found. If both debug and release libraries (or plugins) +are found, proper version is chosen based on actual build configuration of the +project (i.e. `Debug` build is linked to debug libraries, `Release` build to +release libraries). Note that this autodetection might fail for the +`MAGNUM_PLUGINS_DIR` variable, i.e. you might need to switch it manually to +`magnum-d/` or `magnum/` subdirectory based on whether you want to dynamically +load plugins with or without debug information. You can also make use of +`CMAKE_BUILD_TYPE` or `CMAKE_CFG_INTDIR` CMake variables for compile-time +decision. Features of found %Magnum library are exposed in these CMake variables, they are also available as preprocessor variables if including Magnum.h: diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 89bb4ed94..68462478b 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -7,16 +7,19 @@ # 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, defaults to -# `magnum/` subdirectory of dir where Magnum library was found. 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_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 +# MAGNUM_PLUGINS_DIR - Base directory with dynamic plugins, defaults +# to magnum/ subdirectory of dir where Magnum library was found (or magnum-d/ +# in debug build). 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_FONT_DIR - Directory with dynamic font plugins +# MAGNUM_PLUGINS_FONTCONVERTER_DIR - Directory with dynamic font converter +# plugins +# MAGNUM_PLUGINS_IMAGECONVERTER_DIR - Directory with dynamic image converter +# plugins +# MAGNUM_PLUGINS_IMPORTER_DIR - Directory with dynamic importer plugins +# MAGNUM_PLUGINS_AUDIOIMPORTER_DIR - Directory with dynamic audio importer +# plugins # 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 @@ -60,10 +63,15 @@ # / MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS to simplify porting. # # The package is found if either debug or release version of each requested -# library is found. If both debug and release libraries are found, proper -# version is chosen based on actual build configuration of the project (i.e. -# Debug build is linked to debug libraries, Release build to release -# libraries). +# library (or plugin) is found. If both debug and release libraries (or +# plugins) are found, proper version is chosen based on actual build +# configuration of the project (i.e. Debug build is linked to debug libraries, +# Release build to release libraries). Note that this autodetection might fail +# for the MAGNUM_PLUGINS_DIR variable, i.e. you might need to switch it +# manually to magnum-d/ or magnum/ subdirectory based on whether you want +# to dynamically load plugins with or without debug information. You can also +# make use of CMAKE_BUILD_TYPE or CMAKE_CFG_INTDIR CMake variables for +# compile-time decision. # # Features of found Magnum library are exposed in these variables: # MAGNUM_BUILD_DEPRECATED - Defined if compiled with deprecated APIs @@ -89,17 +97,17 @@ # MAGNUM_*_LIBRARY_DEBUG - Debug version of given library, if found # MAGNUM_*_LIBRARY_RELEASE - Release version of given library, if found # MAGNUM_LIBRARY_INSTALL_DIR - Library installation directory -# MAGNUM_PLUGINS_INSTALL_DIR - Plugin installation directory -# MAGNUM_PLUGINS_FONT_INSTALL_DIR - Font plugin installation +# MAGNUM_PLUGINS_[DEBUG|RELEASE]_INSTALL_DIR - Plugin installation directory +# MAGNUM_PLUGINS_FONT_[DEBUG|RELEASE]_INSTALL_DIR - Font plugin installation # directory -# MAGNUM_PLUGINS_FONTCONVERTER_INSTALL_DIR - Font converter plugin -# installation directory -# MAGNUM_PLUGINS_IMAGECONVERTER_INSTALL_DIR - Image converter plugin -# installation directory -# MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR - Importer plugin installation -# directory -# MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR - Audio omporter plugin +# MAGNUM_PLUGINS_FONTCONVERTER_[DEBUG|RELEASE]_INSTALL_DIR - Font converter +# plugin installation directory +# MAGNUM_PLUGINS_IMAGECONVERTER_[DEBUG|RELEASE]_INSTALL_DIR - Image converter +# plugin installation directory +# MAGNUM_PLUGINS_IMPORTER_[DEBUG|RELEASE]_INSTALL_DIR - Importer plugin # installation directory +# MAGNUM_PLUGINS_AUDIOIMPORTER_[DEBUG|RELEASE]_INSTALL_DIR - Audio importer +# plugin installation directory # MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR - Installation dir for CMake Find* # modules # MAGNUM_INCLUDE_INSTALL_DIR - Header installation directory @@ -138,15 +146,21 @@ find_package(Corrade REQUIRED) find_library(MAGNUM_LIBRARY_DEBUG Magnum-d) find_library(MAGNUM_LIBRARY_RELEASE Magnum) -# Set the MAGNUM_LIBRARY variable based on what was found +# Set the MAGNUM_LIBRARY variable based on what was found, use that information +# to guess also build type of dynamic plugins if(MAGNUM_LIBRARY_DEBUG AND MAGNUM_LIBRARY_RELEASE) set(MAGNUM_LIBRARY debug ${MAGNUM_LIBRARY_DEBUG} optimized ${MAGNUM_LIBRARY_RELEASE}) get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_DEBUG} PATH) + # TODO: how to handle this with MSVC and other multi-configuration tools? + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(_MAGNUM_PLUGINS_DIR_SUFFIX "-d") + endif() elseif(MAGNUM_LIBRARY_DEBUG) set(MAGNUM_LIBRARY ${MAGNUM_LIBRARY_DEBUG}) get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_DEBUG} PATH) + set(_MAGNUM_PLUGINS_DIR_SUFFIX "-d") elseif(MAGNUM_LIBRARY_RELEASE) set(MAGNUM_LIBRARY ${MAGNUM_LIBRARY_RELEASE}) get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_RELEASE} PATH) @@ -259,8 +273,30 @@ foreach(component ${Magnum_FIND_COMPONENTS}) # 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}) + + # Try to find both debug and release version. Dynamic and static debug + # libraries are on different places. + find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${component} + PATH_SUFFIXES magnum-d/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) + find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${component}-d + PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) + find_library(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE ${component} + PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) + + # Set the _LIBRARY variable based on what was found + if(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG AND MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) + set(MAGNUM_${_COMPONENT}_LIBRARY + debug ${MAGNUM_${_COMPONENT}_LIBRARY_DEBUG} + optimized ${MAGNUM_${_COMPONENT}_LIBRARY_RELEASE}) + elseif(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG) + set(MAGNUM_${_COMPONENT}_LIBRARY ${MAGNUM_${_COMPONENT}_LIBRARY_DEBUG}) + elseif(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) + set(MAGNUM_${_COMPONENT}_LIBRARY ${MAGNUM_${_COMPONENT}_LIBRARY_RELEASE}) + endif() + set(CMAKE_FIND_LIBRARY_PREFIXES ${_tmp_prefixes}) # Set library defaults, find the library @@ -425,12 +461,18 @@ find_package_handle_standard_args(Magnum # Installation dirs include(CorradeLibSuffix) 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_PLUGINS_DEBUG_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum-d) +set(MAGNUM_PLUGINS_RELEASE_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum) +set(MAGNUM_PLUGINS_FONT_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONT_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/fonts) +set(MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/fontconverters) +set(MAGNUM_PLUGINS_FONTCONVERTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/fontconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/imageconverters) +set(MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_IMPORTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/importers) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/audioimporters) +set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/audioimporters) 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/MagnumPlugins) @@ -440,12 +482,18 @@ mark_as_advanced(FORCE MAGNUM_LIBRARY MAGNUM_INCLUDE_DIR MAGNUM_LIBRARY_INSTALL_DIR - MAGNUM_PLUGINS_INSTALL_DIR - MAGNUM_PLUGINS_FONT_INSTALL_DIR - MAGNUM_PLUGINS_FONTCONVERTER_INSTALL_DIR - MAGNUM_PLUGINS_IMAGECONVERTER_INSTALL_DIR - MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR - MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR + MAGNUM_PLUGINS_DEBUG_INSTALL_DIR + MAGNUM_PLUGINS_RELEASE_INSTALL_DIR + MAGNUM_PLUGINS_FONT_DEBUG_INSTALL_DIR + MAGNUM_PLUGINS_FONT_RELEASE_INSTALL_DIR + MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_INSTALL_DIR + MAGNUM_PLUGINS_FONTCONVERTER_RELEASE_INSTALL_DIR + MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_INSTALL_DIR + MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_INSTALL_DIR + MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR + MAGNUM_PLUGINS_IMPORTER_RELEASE_INSTALL_DIR + MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_INSTALL_DIR + MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_INSTALL_DIR MAGNUM_CMAKE_MODULE_INSTALL_DIR MAGNUM_INCLUDE_INSTALL_DIR MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR) @@ -460,7 +508,7 @@ if(MAGNUM_BUILD_DEPRECATED) endif() # Get base plugin directory from main library location -set(MAGNUM_PLUGINS_DIR ${_MAGNUM_LIBRARY_PATH}/magnum +set(MAGNUM_PLUGINS_DIR ${_MAGNUM_LIBRARY_PATH}/magnum${_MAGNUM_PLUGINS_DIR_SUFFIX} CACHE PATH "Base directory where to look for Magnum plugins") # Plugin directories diff --git a/src/MagnumPlugins/CMakeLists.txt b/src/MagnumPlugins/CMakeLists.txt index 549a69ba0..59dab5adb 100644 --- a/src/MagnumPlugins/CMakeLists.txt +++ b/src/MagnumPlugins/CMakeLists.txt @@ -24,11 +24,11 @@ # # Wrapper for creating given plugin type -macro(add_plugin) +macro(add_plugin plugin_name debug_install_dir release_install_dir metadata_file) if(NOT BUILD_STATIC) - corrade_add_plugin(${ARGN}) + corrade_add_plugin(${plugin_name} ${debug_install_dir} ${release_install_dir} ${metadata_file} ${ARGN}) else() - corrade_add_static_plugin(${ARGN}) + corrade_add_static_plugin(${plugin_name} ${release_install_dir} ${metadata_file} ${ARGN}) endif() endmacro() diff --git a/src/MagnumPlugins/MagnumFont/CMakeLists.txt b/src/MagnumPlugins/MagnumFont/CMakeLists.txt index bc68bb215..54026939f 100644 --- a/src/MagnumPlugins/MagnumFont/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFont/CMakeLists.txt @@ -32,7 +32,7 @@ set(MagnumFont_HEADERS add_library(MagnumFontObjects OBJECT ${MagnumFont_SOURCES}) set_target_properties(MagnumFontObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") -add_plugin(MagnumFont ${MAGNUM_PLUGINS_FONT_INSTALL_DIR} +add_plugin(MagnumFont ${MAGNUM_PLUGINS_FONT_DEBUG_INSTALL_DIR} ${MAGNUM_PLUGINS_FONT_RELEASE_INSTALL_DIR} MagnumFont.conf $ pluginRegistration.cpp) diff --git a/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt b/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt index d50d535a1..e171f6c81 100644 --- a/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt @@ -32,7 +32,7 @@ set(MagnumFontConverter_HEADERS add_library(MagnumFontConverterObjects OBJECT ${MagnumFontConverter_SOURCES}) set_target_properties(MagnumFontConverterObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") -add_plugin(MagnumFontConverter ${MAGNUM_PLUGINS_FONTCONVERTER_INSTALL_DIR} +add_plugin(MagnumFontConverter ${MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_INSTALL_DIR} ${MAGNUM_PLUGINS_FONTCONVERTER_RELEASE_INSTALL_DIR} MagnumFontConverter.conf $ pluginRegistration.cpp) diff --git a/src/MagnumPlugins/ObjImporter/CMakeLists.txt b/src/MagnumPlugins/ObjImporter/CMakeLists.txt index 5ab131c03..63a09e70b 100644 --- a/src/MagnumPlugins/ObjImporter/CMakeLists.txt +++ b/src/MagnumPlugins/ObjImporter/CMakeLists.txt @@ -28,7 +28,7 @@ if(NOT BUILD_STATIC OR BUILD_STATIC_PIC) set_target_properties(ObjImporterObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") endif() -add_plugin(ObjImporter ${MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR} +add_plugin(ObjImporter ${MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR} ${MAGNUM_PLUGINS_IMPORTER_RELEASE_INSTALL_DIR} ObjImporter.conf $ pluginRegistration.cpp) diff --git a/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt b/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt index 5d0f72443..d0f03e2b8 100644 --- a/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt @@ -32,7 +32,7 @@ set(TgaImageConverter_HEADERS add_library(TgaImageConverterObjects OBJECT ${TgaImageConverter_SRCS}) set_target_properties(TgaImageConverterObjects PROPERTIES COMPILE_FLAGS "-DTgaImageConverterObjects_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") -add_plugin(TgaImageConverter ${MAGNUM_PLUGINS_IMAGECONVERTER_INSTALL_DIR} +add_plugin(TgaImageConverter ${MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_INSTALL_DIR} ${MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_INSTALL_DIR} TgaImageConverter.conf $ pluginRegistration.cpp) diff --git a/src/MagnumPlugins/TgaImporter/CMakeLists.txt b/src/MagnumPlugins/TgaImporter/CMakeLists.txt index 6d214d263..05633463d 100644 --- a/src/MagnumPlugins/TgaImporter/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImporter/CMakeLists.txt @@ -33,7 +33,7 @@ set(TgaImporter_HEADERS add_library(TgaImporterObjects OBJECT ${TgaImporter_SRCS}) set_target_properties(TgaImporterObjects PROPERTIES COMPILE_FLAGS "-DTgaImporterObjects_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") -add_plugin(TgaImporter ${MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR} +add_plugin(TgaImporter ${MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR} ${MAGNUM_PLUGINS_IMPORTER_RELEASE_INSTALL_DIR} TgaImporter.conf $ pluginRegistration.cpp) diff --git a/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt b/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt index 7f04461cc..1ba650e7a 100644 --- a/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt +++ b/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt @@ -39,7 +39,7 @@ if(NOT BUILD_STATIC OR BUILD_STATIC_PIC) set_target_properties(WavAudioImporterObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") endif() -add_plugin(WavAudioImporter ${MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR} +add_plugin(WavAudioImporter ${MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_INSTALL_DIR} ${MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_INSTALL_DIR} WavAudioImporter.conf $ pluginRegistration.cpp)