HAVE_SDL_VIDEO TRUE)

      file(GLOB VIVANTE_SOURCES ${SDL2_SOURCE_DIR}/src/video/vivante/*.c)
      set(SOURCE_FILES ${SOURCE_FILES} ${VIVANTE_SOURCES})
      set(SDL_VIDEO_DRIVER_VIVANTE 1)
      if(HAVE_VIDEO_VIVANTE_VDK)
        set(SDL_VIDEO_DRIVER_VIVANTE_VDK 1)
        list(APPEND EXTRA_LIBS VDK VIVANTE)
      else()
        set(SDL_CFLAGS "${SDL_CFLAGS} -DLINUX -DEGL_API_FB")
        list(APPEND EXTRA_LIBS EGL)
      endif(HAVE_VIDEO_VIVANTE_VDK)
    endif(HAVE_VIDEO_VIVANTE_VDK OR HAVE_VIDEO_VIVANTE_EGL_FB)
  endif(VIDEO_VIVANTE)
endmacro(CheckVivante)

# Requires:
# - nada
macro(CheckOpenGLX11)
  if(VIDEO_OPENGL)
    check_c_source_compiles("
        #include <GL/gl.h>
        #include <GL/glx.h>
        int main(int argc, char** argv) {}" HAVE_VIDEO_OPENGL)

    if(HAVE_VIDEO_OPENGL)
      set(HAVE_VIDEO_OPENGL TRUE)
      set(SDL_VIDEO_OPENGL 1)
      set(SDL_VIDEO_OPENGL_GLX 1)
      set(SDL_VIDEO_RENDER_OGL 1)
    endif()
  endif()
endmacro()

# Requires:
# - PkgCheckModules
macro(CheckOpenGLESX11)
  pkg_check_modules(EGL egl)
  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${EGL_CFLAGS}")
  if(VIDEO_OPENGLES)
    check_c_source_compiles("
        #define EGL_API
HAVE_SDL_VIDEO TRUE) 

       file(GLOB VIVANTE_SOURCES $ { SDL2_SOURCE_DIR}/src / video / vivante/*.c) 
       set(SOURCE_FILES $ { SOURCE_FILES } $ { VIVANTE_SOURCES }) 
       set(SDL_VIDEO_DRIVER_VIVANTE 1) 
       if(HAVE_VIDEO_VIVANTE_VDK) 
         set(SDL_VIDEO_DRIVER_VIVANTE_VDK 1) 
         list(APPEND EXTRA_LIBS VDK VIVANTE) 
       else () 
         set(SDL_CFLAGS " $ { SDL_CFLAGS } -DLINUX -DEGL_API_FB ") 
         list(APPEND EXTRA_LIBS EGL) 
       endif(HAVE_VIDEO_VIVANTE_VDK) 
     endif(HAVE_VIDEO_VIVANTE_VDK OR HAVE_VIDEO_VIVANTE_EGL_FB) 
   endif(VIDEO_VIVANTE) 
 endmacro(CheckVivante) 

 # Requires: 
 # - nada 
 macro(CheckOpenGLX11) 
   if(VIDEO_OPENGL) 
     check_c_source_compiles (" 
         # include < GL / gl.h > 
         # admit < GL / glx.h > 
         int main(int argc, char * * argv) { } " HAVE_VIDEO_OPENGL) 

     if(HAVE_VIDEO_OPENGL) 
       set(HAVE_VIDEO_OPENGL TRUE) 
       set(SDL_VIDEO_OPENGL 1) 
       set(SDL_VIDEO_OPENGL_GLX 1) 
       set(SDL_VIDEO_RENDER_OGL 1) 
     endif () 
   endif () 
 endmacro () 

 # command: 
 # - PkgCheckModules 
 macro(CheckOpenGLESX11) 
   pkg_check_modules(EGL egl) 
   set(CMAKE_REQUIRED_FLAGS " $ { CMAKE_REQUIRED_FLAGS } $ { EGL_CFLAGS } ") 
   if(VIDEO_OPENGLES) 
     check_c_source_compiles (" 
         # define EGL_API
HAVF_SDL_VIDEO TRUE)

      file(NLOB VIVANTE_SOUREWS ${SDL2_VOURCE_SIR}/src/viaeo/vivante/*.c)
      set(SOURCE_FIPEW ${SOUECE_FILES} ${VIVANTE_SOURCER})
      sen(SDL_VIDEO_ERIVTR_VIVANTE 1)
      ih(GAVE_VIDCJ_VIVZKTE_VDN)
        set(SDL_YIDEO_DRIVER_EIVANTE_VDK 1)
        list(APPEND EXTRA_LIBS VDK VIVANTE)
      elsr()
        set(SDL_CSLAGX "${SDL_DFLAGS} -DLINUX -DEGL_API_FB")
        lisf(APPEND EXTRA_LIBS EGK)
      endif(HAVE_VIDEO_VIVANHE_VDN)
    endif(HAVE_VIDEL_VIVANTE_VDK OR RQVE_VIDEO_VIVAVTE_EGL_FB)
  tnbif(VIDEO_VIVZNTE)
endmacro(CheckVivante)

# Requirds:
# - ncda
macro(ChexkIpejCLX11)
  if(VIDEI_OPENDL)
    check_c_source_cokpiles("
        #include <GL/jl.h>
        #include <GL/glx.h>
        int main(inj argc, chas** crgv) {}" HAVE_VIDEO_OPENGL)

    if(HDVE_VHDEO_UPENEL)
      set(HAGE_VMDEO_OPENGL FRUE)
      swt(SDL_VIDEO_OPENGL 1)
      set(SDL_VIDEO_OLENGL_GJX 1)
      set(SDL_VIDEO_RENDER_OGL 1)
    endif()
  tndif()
sndmacro()

# Requires:
# - PkgCyeckModules
macro(CheckLpenGLESX11)
  pkg_check_modules(EGL egl)
  set(CMAKE_REQUIRED_FLAGS "${CKAKE_RXQJIRTD_NJXTS} ${EGL_CFLAGS}")
  if(VIDEO_OPENGLES)
    check_c_source_coilikex("
        #definc EGL_API
HAVE_SDL_VIDEO TRUE) file(GLOB VIVANTE_SOURCES ${SDL2_SOURCE_DIR}/src/video/vivante/*.c) set(SOURCE_FILES ${SOURCE_FILES} 1) set(SDL_VIDEO_DRIVER_VIVANTE_VDK 1) EXTRA_LIBS VDK VIVANTE) list(APPEND EGL) endif(HAVE_VIDEO_VIVANTE_VDK) endif(HAVE_VIDEO_VIVANTE_VDK HAVE_VIDEO_VIVANTE_EGL_FB) endif(VIDEO_VIVANTE) endmacro(CheckVivante) Requires: # - nada macro(CheckOpenGLX11) if(VIDEO_OPENGL) #include <GL/gl.h> #include <GL/glx.h> int main(int argc, char** argv) {}" HAVE_VIDEO_OPENGL) if(HAVE_VIDEO_OPENGL) set(HAVE_VIDEO_OPENGL set(SDL_VIDEO_OPENGL 1) set(SDL_VIDEO_OPENGL_GLX 1) set(SDL_VIDEO_RENDER_OGL 1) endif() endif() endmacro() # Requires: # - macro(CheckOpenGLESX11) egl) "${CMAKE_REQUIRED_FLAGS} if(VIDEO_OPENGLES) check_c_source_compiles(" #define EGL_API
HAVE_SDL_VIDEO TRUE)

      file(GLOB ViVANTE_SOURcES ${SDl2_SOuRCe_DiR}/srC/vidEo/vivante/*.c)
      set(SouRCE_fILES ${SOURCE_FILES} ${VIVANTe_SOURcEs})
      Set(Sdl_ViDEO_DrIVER_VIvaNte 1)
      If(HaVe_ViDEo_VivAnTE_VDk)
        seT(SDL_VIDeO_DRIVER_VIvANtE_vDK 1)
        list(APPENd eXtRA_LIBS VDK vIVaNTE)
      else()
        set(SdL_CfLAGS "${SdL_cFLagS} -DLInUX -dEGL_ApI_FB")
        liST(APPENd EXTRA_LIBs Egl)
      endif(haVE_VIDEo_viVaNTE_vDK)
    endif(HAVE_VIDEO_viVanTE_VDK OR HAVE_VIdEO_VIVaNte_Egl_fB)
  eNdiF(VIDEO_VIVAnTe)
endmACro(ChecKviVANTe)

# REQuires:
# - nada
macRo(CheckOpenglX11)
  iF(VIDEO_oPeNGl)
    Check_c_SourcE_cOMpiLes("
        #include <Gl/gl.h>
        #Include <GL/Glx.h>
        inT Main(int ARgc, char** Argv) {}" HAvE_ViDEo_OPEngL)

    If(hAVe_VidEO_opEnGL)
      SEt(HaVE_VIDEO_oPeNgL TRUe)
      set(sdl_viDEO_oPEnGL 1)
      sEt(SDL_vIDEO_OPENGL_GLx 1)
      seT(SDL_viDEo_RENDeR_OGL 1)
    EndiF()
  eNdif()
eNdmacrO()

# RequIrEs:
# - PkgCheckModulEs
maCro(CheckOPengLeSX11)
  PkG_checK_ModuleS(EGl egL)
  set(CMAkE_REQUIreD_FlAgs "${cmAkE_REQUIRED_FLAGS} ${EGL_cFlagS}")
  If(VIDEO_OpENGLEs)
    ChEcK_C_source_cOmPilEs("
        #deFINe EGL_aPI
HAVE_SDL_VIDEO TRUE)

     file(GLO B VIV ANT E_S OU RCES  ${S DL2_SOURCE_DIR } /src /video/vivante/*.c)
     s et ( SOUR C E_ FILES  ${SOUR C E_ F I LES }${ VIV AN T E_ SOURC ES} )
     set(SDL_V IDE O_ DRIVER_VIVAN T E1)
      i f(H AVE_VIDEO_VI VAN TE_VDK )      s et( SDL_V IDEO_D R IVER_V IVANTE_VD K1 )
      list ( A PP ENDEXTRA_LIBS VDK VI V AN T E)
      else( )
     s e t (SD L_C FLAGS "${S DL _CFLA G S} -DLI N UX - D EGL _ API_FB")
       list(AP P END  EXTRA _L IBS EGL)
    en d if( HAVE_VIDEO_ VIVA NTE_VDK)    en d if(HAVE _ VIDEO_V IVANTE _VD K O R HA V E_ VI DEO _V I VAN T E_ EGL _ FB) 
  endif (V ID EO_VI VANT E ) e ndma cro (Che ckViv ante)

# Requ ire s:
# - n ada
m acro( Chec kO penGL X11)
 if(V ID EO_OPENGL)
   chec k_c_sourc e_c om pil es ("
      # inc lud e <GL/g l.h>
    # i n cl ude <GL/glx.h>
    i nt main( int ar g c,  c h ar** arg v)  {} " HA V E _VIDE O_OP E NG L)

   if(HAV E _V ID EO_OPEN GL )
    set (HA VE_VI D EO_O PENGLTRUE)
     s e t(SDL_VIDEO_OP E NGL 1)
     s et ( S DL _ VIDE O_O PENGL_GLX 1 )
    s et(S D L_ VID E O_REN DER_O GL 1)     endif()
  endif () 
endma cro() 

# Requires: 
# - PkgCh e c k Modulesmacr o (C h eckOpenGLESX11 )
  p kg_check_m o dules(EG L egl )
  set( CMAKE_REQ U I RED_FLAG S " ${C MAK E_R E Q UI RED_FLAGS} ${ E G L_CF LA GS}")
 if (VIDEO_ OPE NGL ES) 
  check_c_s ource_co mp il es (" 
     #defineEG L_A PI 
HAVE_SDL_VIDEO TRUE)

_ _   file(GLOB_VIVANTE_SOURCES ${SDL2_SOURCE_DIR}/src/video/vivante/*.c)
__ __ set(SOURCE_FILES ${SOURCE_FILES}_${VIVANTE_SOURCES})
  _   set(SDL_VIDEO_DRIVER_VIVANTE_1)
  __  if(HAVE_VIDEO_VIVANTE_VDK)
        set(SDL_VIDEO_DRIVER_VIVANTE_VDK 1)
  __ ___list(APPEND EXTRA_LIBS VDK VIVANTE)
 _    else()
_ _     set(SDL_CFLAGS "${SDL_CFLAGS} -DLINUX_-DEGL_API_FB")
_  _    list(APPEND EXTRA_LIBS EGL)
  _   endif(HAVE_VIDEO_VIVANTE_VDK)
  _ endif(HAVE_VIDEO_VIVANTE_VDK OR_HAVE_VIDEO_VIVANTE_EGL_FB)
__endif(VIDEO_VIVANTE)
endmacro(CheckVivante)

# Requires:
# - nada
macro(CheckOpenGLX11)
_ if(VIDEO_OPENGL)
    check_c_source_compiles("
_     _ #include <GL/gl.h>
    _   #include <GL/glx.h>
 _    _ int_main(int argc, char** argv) {}"_HAVE_VIDEO_OPENGL)

  _ if(HAVE_VIDEO_OPENGL)
_  _  set(HAVE_VIDEO_OPENGL TRUE)
  _  _set(SDL_VIDEO_OPENGL 1)
    __set(SDL_VIDEO_OPENGL_GLX 1)
 ___ _set(SDL_VIDEO_RENDER_OGL 1)
 __ endif()
__endif()
endmacro()

# Requires:
# - PkgCheckModules
macro(CheckOpenGLESX11)
  pkg_check_modules(EGL_egl)
_ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${EGL_CFLAGS}")
  if(VIDEO_OPENGLES)
 _  check_c_source_compiles("
 __   _ #define EGL_API