From 881be9b9853480c14ee6cf1da2ecc255d4c0c8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Jul 2019 20:59:14 +0200 Subject: [PATCH] modules: updated FindMagnum.cmake. --- modules/FindMagnum.cmake | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index f8da1e6..1f77aee 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -25,9 +25,7 @@ # MAGNUM_PLUGINS_DIR - Base directory with dynamic plugins, defaults # to :variable:`MAGNUM_PLUGINS_RELEASE_DIR` in release builds and # multi-configuration builds or to :variable:`MAGNUM_PLUGINS_DEBUG_DIR` in -# debug builds. You can modify all three variables (e.g. set them to ``.`` -# when deploying on Windows with plugins stored relatively to the -# executable), the following ``MAGNUM_PLUGINS_*_DIR`` variables depend on it. +# debug builds # MAGNUM_PLUGINS_FONT[|_DEBUG|_RELEASE]_DIR - Directory with dynamic font # plugins # MAGNUM_PLUGINS_FONTCONVERTER[|_DEBUG|_RELEASE]_DIR - Directory with dynamic @@ -67,6 +65,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 @@ -125,8 +125,6 @@ # MAGNUM_BUILD_DEPRECATED - Defined if compiled with deprecated APIs # included # MAGNUM_BUILD_STATIC - Defined if compiled as static libraries -# MAGNUM_BUILD_MULTITHREADED - Defined if compiled in a way that allows -# having multiple thread-local Magnum contexts # MAGNUM_TARGET_GL - Defined if compiled with OpenGL interop # MAGNUM_TARGET_GLES - Defined if compiled for OpenGL ES # MAGNUM_TARGET_GLES2 - Defined if compiled for OpenGL ES 2.0 @@ -137,6 +135,13 @@ # MAGNUM_TARGET_HEADLESS - Defined if compiled for headless machines # MAGNUM_TARGET_VK - Defined if compiled with Vulkan interop # +# The following variables are provided for backwards compatibility purposes +# only when MAGNUM_BUILD_DEPRECATED is enabled and will be removed in a future +# release: +# +# MAGNUM_BUILD_MULTITHREADED - Alias to CORRADE_BUILD_MULTITHREADED. Use +# CORRADE_BUILD_MULTITHREADED instead. +# # Additionally these variables are defined for internal usage: # # MAGNUM_INCLUDE_DIR - Root include dir (w/o dependencies) @@ -244,7 +249,6 @@ set(_magnumFlags # So far that's not a problem, but might become an issue for new flags. BUILD_DEPRECATED BUILD_STATIC - BUILD_MULTITHREADED TARGET_GL TARGET_GLES TARGET_GLES2 @@ -260,6 +264,11 @@ foreach(_magnumFlag ${_magnumFlags}) endif() endforeach() +# For compatibility only, to be removed at some point +if(MAGNUM_BUILD_DEPRECATED AND CORRADE_BUILD_MULTITHREADED) + set(MAGNUM_BUILD_MULTITHREADED 1) +endif() + # OpenGL library preference. Prefer to use GLVND, since that's the better # approach nowadays, but allow the users to override it from outside in case # it is broken for some reason (Nvidia drivers in Debian's testing (Buster) -- @@ -338,10 +347,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 @@ -410,6 +419,10 @@ endif() set(_MAGNUM_Trade_DEPENDENCIES ) set(_MAGNUM_AndroidApplication_DEPENDENCIES GL) +set(_MAGNUM_EmscriptenApplication_DEPENDENCIES) +if(MAGNUM_TARGET_GL) + list(APPEND _MAGNUM_EmscriptenApplication_DEPENDENCIES GL) +endif() set(_MAGNUM_GlfwApplication_DEPENDENCIES ) if(MAGNUM_TARGET_GL) @@ -610,6 +623,8 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) set_property(TARGET Magnum::${_component} APPEND PROPERTY INTERFACE_LINK_LIBRARIES android EGL::EGL) + # EmscriptenApplication has no additional dependencies + # GLFW application dependencies elseif(_component STREQUAL GlfwApplication) find_package(GLFW)