From 01d0abb9fcc76105f7aa29abae1eb6fd28f0cdd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 26 Jun 2020 19:40:41 +0200 Subject: [PATCH] modules: updated FindMagnum and FindGLFW. --- modules/FindGLFW.cmake | 14 ++++++++++---- modules/FindMagnum.cmake | 4 +--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/FindGLFW.cmake b/modules/FindGLFW.cmake index 4955676..3d7d99b 100644 --- a/modules/FindGLFW.cmake +++ b/modules/FindGLFW.cmake @@ -43,11 +43,17 @@ # DEALINGS IN THE SOFTWARE. # -# GLFW installs cmake package config files to shared/ folder which handles -# dependencies in case GLFW is built statically. Try to find first, quietly, so -# it doesn't print loud messages when it's not found, since that's okay. -find_package(glfw3 CONFIG QUIET) +# GLFW installs cmake package config files which handles dependencies in case +# GLFW is built statically. Try to find first, quietly, so it doesn't print +# loud messages when it's not found, since that's okay. If the glfw target +# already exists, it means we're using it through a CMake subproject -- don't +# attempt to find the package in that case. +if(NOT TARGET glfw) + find_package(glfw3 CONFIG QUIET) +endif() +# If either a glfw config file was found or we have a subproject, point +# GLFW::GLFW to that and exit -- nothing else to do here. if(TARGET glfw) if(NOT TARGET GLFW::GLFW) # Aliases of (global) targets are only supported in CMake 3.11, so we diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 7d466f0..8761448 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -817,9 +817,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) elseif(_component STREQUAL Audio) find_package(OpenAL) set_property(TARGET Magnum::${_component} APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES ${OPENAL_INCLUDE_DIR}) - set_property(TARGET Magnum::${_component} APPEND PROPERTY - INTERFACE_LINK_LIBRARIES ${OPENAL_LIBRARY} Corrade::PluginManager) + INTERFACE_LINK_LIBRARIES Corrade::PluginManager OpenAL::OpenAL) # No special setup for DebugTools library