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 $)