Browse Source

modules: actually detect the MAGNUM_PLUGINS_DIR.

It now defaults to magnum/ subdirectory of dir where main Magnum library
was found. It was *annoying* to change /usr/local/lib/magnum to
/usr/lib/magnum _every time_.
pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
30aae1bd48
  1. 9
      doc/cmake.dox
  2. 11
      modules/FindMagnum.cmake

9
doc/cmake.dox

@ -44,10 +44,11 @@ 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_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

11
modules/FindMagnum.cmake

@ -7,9 +7,10 @@
# 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
# 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
@ -404,7 +405,9 @@ if(MAGNUM_BUILD_DEPRECATED)
set(MAGNUM_PLUGINS_INCLUDE_DIR ${MAGNUM_INCLUDE_DIR}/MagnumPlugins)
endif()
set(MAGNUM_PLUGINS_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}
# Get base plugin directory from main library location
get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY} PATH)
set(MAGNUM_PLUGINS_DIR ${_MAGNUM_LIBRARY_PATH}/magnum
CACHE PATH "Base directory where to look for Magnum plugins")
# Plugin directories

Loading…
Cancel
Save