@ -422,6 +422,17 @@ if(MAGNUM_WITH_GLXAPPLICATION)
message ( FATAL_ERROR "X11 library, required by some applications, was not found. Set MAGNUM_WITH_*X*APPLICATION to OFF to skip building them." )
endif ( )
# I f w e ' r e t a r g e t i n g G L E S a n d E G L , o n l y t h e l i b G L E S l i b r a r y i s l o o k e d f o r
# b y d e f a u l t . H e r e w e n e e d l i b G L X f r o m G L V N D i n a d d i t i o n . I f G L V N D i s n o t
# a v a i l a b l e however ( or CMake < 3.10 is used ) , f a i l , a s G L X s y m b o l s a r e
# o n l y i n l i b G L i n t h a t c a s e , w h i c h w o u l d c o n f l i c t w i t h l i b G L E S .
if ( MAGNUM_TARGET_GLES AND MAGNUM_TARGET_EGL )
find_package ( OpenGL )
if ( NOT OpenGL_FOUND OR NOT OPENGL_opengl_LIBRARY OR NOT OpenGL_GL_PREFERENCE STREQUAL GLVND )
message ( SEND_ERROR "Without GLVND, GlxApplication is available only if MAGNUM_TARGET_EGL is disabled. Use XEglApplication on EGL instead." )
endif ( )
endif ( )
set ( MagnumGlxApplication_SRCS
G l x A p p l i c a t i o n . c p p
$ < T A R G E T _ O B J E C T S : M a g n u m A b s t r a c t X A p p l i c a t i o n >
@ -446,6 +457,9 @@ if(MAGNUM_WITH_GLXAPPLICATION)
# C a n ' t u s e O p e n G L _ O p e n G L _ F O U N D , b e c a u s e t h a t o n e i s s e t a l s o i f G L V N D i s
# * n o t * f o u n d . W T F . A l s o c a n ' t j u s t c h e c k f o r O P E N G L _ o p e n g l _ L I B R A R Y b e c a u s e
# t h a t ' s s e t e v e n i f O p e n G L _ G L _ P R E F E R E N C E i s e x p l i c i t l y s e t t o L E G A C Y .
#
# S e e a l s o t h e l o g i c a b o v e f o r p r e v e n t i n g l i b G L a n d l i b G L E S c o n f l i c t s . I f
# t h e r e ' s n o c o n f l i c t , t h i s b r a n c h i s t a k e n a n d l i b G L X i s l i n k e d .
if ( OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND )
target_link_libraries ( MagnumGlxApplication PUBLIC OpenGL::GLX )
endif ( )
@ -479,6 +493,10 @@ if(MAGNUM_WITH_XEGLAPPLICATION)
message ( FATAL_ERROR "X11 library, required by some applications, was not found. Set MAGNUM_WITH_*X*APPLICATION to OFF to skip building them." )
endif ( )
# U n l i k e w i t h G l x A p p l i c a t i o n a b o v e , h e r e n o c o n f l i c t b e t w e e n l i b G L E S a n d
# l i b G L c a n h a p p e n - - w e o n l y e i t h e r l i n k l i b G L E S a n d l i b E G L o r l i b G L a n d
# l i b E G L .
set ( MagnumXEglApplication_SRCS
X E g l A p p l i c a t i o n . c p p
$ < T A R G E T _ O B J E C T S : M a g n u m A b s t r a c t X A p p l i c a t i o n >
@ -557,6 +575,17 @@ if(MAGNUM_WITH_WINDOWLESSGLXAPPLICATION)
message ( FATAL_ERROR "X11 library, required by some applications, was not found. Set MAGNUM_WITH_*X*APPLICATION to OFF to skip building them." )
endif ( )
# I f w e ' r e t a r g e t i n g G L E S a n d E G L , o n l y t h e l i b G L E S l i b r a r y i s l o o k e d f o r
# b y d e f a u l t . H e r e w e n e e d l i b G L X f r o m G L V N D i n a d d i t i o n . I f G L V N D i s n o t
# a v a i l a b l e however ( or CMake < 3.10 is used ) , f a i l , a s G L X s y m b o l s a r e
# o n l y i n l i b G L i n t h a t c a s e , w h i c h w o u l d c o n f l i c t w i t h l i b G L E S .
if ( MAGNUM_TARGET_GLES AND MAGNUM_TARGET_EGL )
find_package ( OpenGL )
if ( NOT OpenGL_FOUND OR NOT OPENGL_opengl_LIBRARY OR NOT OpenGL_GL_PREFERENCE STREQUAL GLVND )
message ( SEND_ERROR "Without GLVND, WindowlessGlxApplication is available only if MAGNUM_TARGET_EGL is disabled. Use WindowlessEglApplication on EGL instead." )
endif ( )
endif ( )
set ( MagnumWindowlessGlxApplication_SRCS
W i n d o w l e s s G l x A p p l i c a t i o n . c p p
$ < T A R G E T _ O B J E C T S : M a g n u m G l x C o n t e x t O b j e c t s > )