Browse Source

modules: different search order for plugin libs in FindMagnum.

This makes Vcpkg-built static plugins be found correctly. Previously
both the debug and release variant pointed to the same lib.
pull/338/head
Vladimír Vondruš 7 years ago
parent
commit
8b37d4fd78
  1. 2
      doc/changelog.dox
  2. 12
      modules/FindMagnum.cmake

2
doc/changelog.dox

@ -280,6 +280,8 @@ See also:
[OpenGL_GL_PREFERENCE](https://cmake.org/cmake/help/v3.11/module/FindOpenGL.html#linux-specific) [OpenGL_GL_PREFERENCE](https://cmake.org/cmake/help/v3.11/module/FindOpenGL.html#linux-specific)
from outside on systems where GLVND doesn't work properly (before the build from outside on systems where GLVND doesn't work properly (before the build
scripts and `FindMagnum.cmake` always forced GLVND) scripts and `FindMagnum.cmake` always forced GLVND)
- `FindMagnum.cmake` now correctly finds debug versions of statically built
plugins when using Vcpkg
@subsection changelog-latest-bugfixes Bug fixes @subsection changelog-latest-bugfixes Bug fixes

12
modules/FindMagnum.cmake

@ -550,11 +550,17 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};") set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};")
# Try to find both debug and release version. Dynamic and static # Try to find both debug and release version. Dynamic and static
# debug libraries are in different places. # debug libraries are in different places. Static debug plugins are
find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component} # in magnum/ with a -d suffix while dynamic debug plugins are in
PATH_SUFFIXES magnum-d/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) # magnum-d/ with no suffix. Problem is that Vcpkg's library linking
# automagic needs the static libs to be in the root library
# directory along with everything else and so we need to search for
# the -d suffixed version *before* the unsuffixed so it doesn't
# pick the release library for both debug and release.
find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component}-d find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component}-d
PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component}
PATH_SUFFIXES magnum-d/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
find_library(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE ${_component} find_library(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE ${_component}
PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
mark_as_advanced(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG mark_as_advanced(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG

Loading…
Cancel
Save