From e9af67a651040079b08d0765b07568c356733e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 May 2018 16:35:13 +0200 Subject: [PATCH] Platform: properly link X11 to all applications that need it. Discovered by the fresh Platform tests -- the X11 package was called *after* X11_LIBRARIES was used. --- src/Magnum/Platform/CMakeLists.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 9010c8d09..90d628952 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -231,6 +231,11 @@ if(WITH_GLXAPPLICATION) set(NEED_GLXCONTEXTHANDLER 1) set(NEED_GLXCONTEXT 1) + find_package(X11) + if(NOT X11_FOUND) + message(FATAL_ERROR "X11 library, required by some applications, was not found. Set WITH_*X*APPLICATION to OFF to skip building them.") + endif() + set(MagnumGlxApplication_SRCS GlxApplication.cpp $ @@ -269,6 +274,11 @@ if(WITH_XEGLAPPLICATION) message(FATAL_ERROR "EGL library, required by some applications, was not found. Set WITH_*EGL*APPLICATION to OFF to skip building them.") endif() + find_package(X11) + if(NOT X11_FOUND) + message(FATAL_ERROR "X11 library, required by some applications, was not found. Set WITH_*X*APPLICATION to OFF to skip building them.") + endif() + set(MagnumXEglApplication_SRCS XEglApplication.cpp $ @@ -297,13 +307,6 @@ if(WITH_XEGLAPPLICATION) add_library(Magnum::XEglApplication ALIAS MagnumXEglApplication) endif() -if(WITH_WINDOWLESSGLXAPPLICATION OR NEED_ABSTRACTXAPPLICATION) - find_package(X11) - if(NOT X11_FOUND) - message(FATAL_ERROR "X11 library, required by some contexts, was not found. Set WITH_*X*APPLICATION to OFF to skip building them.") - endif() -endif() - # Windowless EGL application if(WITH_WINDOWLESSEGLAPPLICATION) set(NEED_EGLCONTEXT 1) @@ -343,6 +346,11 @@ endif() if(WITH_WINDOWLESSGLXAPPLICATION) set(NEED_GLXCONTEXT 1) + find_package(X11) + if(NOT X11_FOUND) + message(FATAL_ERROR "X11 library, required by some applications, was not found. Set WITH_*X*APPLICATION to OFF to skip building them.") + endif() + set(MagnumWindowlessGlxApplication_SRCS WindowlessGlxApplication.cpp $)