# Adding GLES Support to FindOpenGL

**URL:** https://discourse.cmake.org/t/adding-gles-support-to-findopengl/2087
**Category:** Development
**Created:** [October 28, 2020, 8:23pm UTC](https://discourse.cmake.org/t/adding-gles-support-to-findopengl/2087 "2020-10-28T20:23:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![warisb](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/df705f/32.png) [@warisb](https://discourse.cmake.org/u/warisb)
#### Post date: [October 28, 2020, 8:23pm UTC](https://discourse.cmake.org/t/adding-gles-support-to-findopengl/2087/1 "2020-10-28T20:23:12Z")

</div>

Hi there, please bear with me as this is my first post.

I would like to discuss this particular comment in the FindOpenGL.cmake file

> For EGL targets the client must rely on GLVND support on the user’s system. Linking should use the `OpenGL::OpenGL OpenGL::EGL` targets. Using GLES\* libraries is theoretically possible in place of `OpenGL::OpenGL`, but this module does not currently support that; contributions welcome.

In particular

> Using GLES\* libraries is theoretically possible in place of `OpenGL::OpenGL`, but this  
> module does not currently support that; contributions welcome.

I want to help make this contribution, but I want to make sure I’m not missing anything. I have an environment which seems to exercise this missing feature: a Yocto-based embedded Linux which uses GLES. I added a quick hack which makes the FindOpenGL module look for libEGLv2.so instead of libOpenGL.so, and it seems to work. So I thought the fix would just be something like

```
if (NOT OPENGL_opengl_LIBRARY)
    # look again for EGLv1/v2

```

This seems too easy to be true, so I’m sure I’m missing something. Could someone more knowledgeable in this area let me know if this is a viable fix?

Thanks a lot.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [October 29, 2020, 1:48pm UTC](https://discourse.cmake.org/t/adding-gles-support-to-findopengl/2087/2 "2020-10-29T13:48:38Z")

</div>

Cc: @chuckatkins @ben.boeckel

For reference, that comment was left behind by [CMake MR 782](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/782). Since then there have been at least two attempts at adding GLES support that were never finished:

- [https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/2445](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/2445)
- [https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/3924](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/3924)
