Separate EGL / GL ES detection in CMake
authorGabriel Jacobo <gabomdq@gmail.com>
Thu, 22 Aug 2013 14:56:07 -0300
changeset 769076d7b6007a64
parent 7689 c64896ddeeae
child 7691 cf99258f905c
Separate EGL / GL ES detection in CMake
cmake/sdlchecks.cmake
include/SDL_config.h.cmake
     1.1 --- a/cmake/sdlchecks.cmake	Thu Aug 22 13:32:27 2013 -0400
     1.2 +++ b/cmake/sdlchecks.cmake	Thu Aug 22 14:56:07 2013 -0300
     1.3 @@ -563,25 +563,29 @@
     1.4    if(VIDEO_OPENGLES)
     1.5      check_c_source_compiles("
     1.6          #include <EGL/egl.h>
     1.7 -        int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES)
     1.8 -    if(HAVE_VIDEO_OPENGLES)
     1.9 -      check_c_source_compiles("
    1.10 -          #include <GLES/gl.h>
    1.11 -          #include <GLES/glext.h>
    1.12 -          int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V1)
    1.13 -      if(HAVE_VIDEO_OPENGLES_V1)
    1.14 +        int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL)
    1.15 +    if(HAVE_VIDEO_OPENGL_EGL)
    1.16 +        set(SDL_VIDEO_OPENGL_EGL 1)
    1.17 +    endif(HAVE_VIDEO_OPENGL_EGL) 
    1.18 +    check_c_source_compiles("
    1.19 +      #include <GLES/gl.h>
    1.20 +      #include <GLES/glext.h>
    1.21 +      int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V1)
    1.22 +    if(HAVE_VIDEO_OPENGLES_V1)
    1.23 +        set(HAVE_VIDEO_OPENGLES TRUE)
    1.24          set(SDL_VIDEO_OPENGL_ES 1)
    1.25          set(SDL_VIDEO_RENDER_OGL_ES 1)
    1.26 -      endif(HAVE_VIDEO_OPENGLES_V1)
    1.27 -      check_c_source_compiles("
    1.28 -          #include <GLES2/gl2.h>
    1.29 -          #include <GLES2/gl2ext.h>
    1.30 -          int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V2)
    1.31 -      if(HAVE_VIDEO_OPENGLES_V2)
    1.32 +    endif(HAVE_VIDEO_OPENGLES_V1)
    1.33 +    check_c_source_compiles("
    1.34 +      #include <GLES2/gl2.h>
    1.35 +      #include <GLES2/gl2ext.h>
    1.36 +      int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V2)
    1.37 +    if(HAVE_VIDEO_OPENGLES_V2)
    1.38 +        set(HAVE_VIDEO_OPENGLES TRUE)
    1.39          set(SDL_VIDEO_OPENGL_ES2 1)
    1.40          set(SDL_VIDEO_RENDER_OGL_ES2 1)
    1.41 -      endif(HAVE_VIDEO_OPENGLES_V2)
    1.42 -    endif(HAVE_VIDEO_OPENGLES)
    1.43 +    endif(HAVE_VIDEO_OPENGLES_V2)
    1.44 +
    1.45    endif(VIDEO_OPENGLES)
    1.46  endmacro(CheckOpenGLESX11)
    1.47  
     2.1 --- a/include/SDL_config.h.cmake	Thu Aug 22 13:32:27 2013 -0400
     2.2 +++ b/include/SDL_config.h.cmake	Thu Aug 22 14:56:07 2013 -0300
     2.3 @@ -293,6 +293,7 @@
     2.4  #cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
     2.5  #cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@
     2.6  #cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@
     2.7 +#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@
     2.8  #cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@
     2.9  #cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@
    2.10