Browse Source

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.
pull/249/merge
Vladimír Vondruš 8 years ago
parent
commit
e9af67a651
  1. 22
      src/Magnum/Platform/CMakeLists.txt

22
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
$<TARGET_OBJECTS:MagnumAbstractXApplication>
@ -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
$<TARGET_OBJECTS:MagnumAbstractXApplication>
@ -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
$<TARGET_OBJECTS:MagnumGlxContextObjects>)

Loading…
Cancel
Save