Skip to content

Commit

Permalink
modules: Update FindMagnum.cmake
Browse files Browse the repository at this point in the history
Signed-off-by: Squareys <squareys@googlemail.com>
  • Loading branch information
Squareys committed May 5, 2019
1 parent f08d48c commit 8157676
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions modules/FindMagnum.cmake
Expand Up @@ -67,6 +67,8 @@
# TextureTools - TextureTools library
# Trade - Trade library
# Vk - Vk library
# AndroidApplication - Android application
# EmscriptenApplication - Emscripten application
# GlfwApplication - GLFW application
# GlxApplication - GLX application
# Sdl2Application - SDL2 application
Expand Down Expand Up @@ -338,10 +340,10 @@ endif()
set(_MAGNUM_LIBRARY_COMPONENT_LIST
Audio DebugTools GL MeshTools Primitives SceneGraph Shaders Text
TextureTools Trade Vk
AndroidApplication GlfwApplication GlxApplication Sdl2Application
XEglApplication WindowlessCglApplication WindowlessEglApplication
WindowlessGlxApplication WindowlessIosApplication WindowlessWglApplication
WindowlessWindowsEglApplication
AndroidApplication EmscriptenApplication GlfwApplication GlxApplication
Sdl2Application XEglApplication WindowlessCglApplication
WindowlessEglApplication WindowlessGlxApplication WindowlessIosApplication
WindowlessWglApplication WindowlessWindowsEglApplication
CglContext EglContext GlxContext WglContext
OpenGLTester)
set(_MAGNUM_PLUGIN_COMPONENT_LIST
Expand Down Expand Up @@ -410,6 +412,10 @@ endif()

set(_MAGNUM_Trade_DEPENDENCIES )
set(_MAGNUM_AndroidApplication_DEPENDENCIES GL)
set(_MAGNUM_EmscriptenApplication_DEPENDENCIES GL)
if(MAGNUM_TARGET_GL)
list(APPEND _MAGNUM_EmscriptenApplication_DEPENDENCIES GL)
endif()

set(_MAGNUM_GlfwApplication_DEPENDENCIES )
if(MAGNUM_TARGET_GL)
Expand Down Expand Up @@ -550,11 +556,17 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};")

# Try to find both debug and release version. Dynamic and static
# debug libraries are in different places.
find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component}
PATH_SUFFIXES magnum-d/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
# debug libraries are in different places. Static debug plugins are
# in magnum/ with a -d suffix while dynamic debug plugins are in
# 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
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}
PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
mark_as_advanced(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG
Expand Down

0 comments on commit 8157676

Please sign in to comment.