I don't see anything clearly wrong here, we seem to be adding EGL libraries correctly here:
Could you please check the value of OPENGL_egl_LIBRARY in the generated CMakeCache.txt? For me it's set to /usr/lib/x86_64-linux-gnu/libEGL.so and this library is present in the linker command.
Any ideas would be welcome...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Hello,
I debugged how that code from build/cmake/init.cmake works here:
<============== Enters here!
find_package(OpenGL)
if(OPENGL_FOUND)
<============== Enters here!
foreach(gltarget OpenGL::GL OpenGL::GLU OpenGL::OpenGL)
if(TARGET ${gltarget})
set(OPENGL_LIBRARIES ${gltarget} ${OPENGL_LIBRARIES})
endif()
endforeach()
endif()
if(WXGTK3 AND OpenGL_EGL_FOUND AND wxUSE_GLCANVAS_EGL)
<============== Enters here!
if(TARGET OpenGL::EGL)
<============== DOES NOT enter here!
set(OPENGL_LIBRARIES OpenGL::EGL ${OPENGL_LIBRARIES})
endif()
set(OPENGL_INCLUDE_DIR ${OPENGL_INCLUDE_DIR} ${OPENGL_EGL_INCLUDE_DIRS})
find_package(WAYLANDEGL)
if(WAYLANDEGL_FOUND AND wxHAVE_GDK_WAYLAND)
list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES})
endif()
endif()
Perhaps, it is something that it can happen if libEGL works but it doesn't support OpenGL::EGL because it's old.
What do you think about a change like this one?
if(TARGET OpenGL::EGL)
set(OPENGL_LIBRARIES OpenGL::EGL ${OPENGL_LIBRARIES})
else()
set(OPENGL_LIBRARIES ${OPENGL_egl_LIBRARY} ${OPENGL_LIBRARIES})
endif()
The above change allows me to build successfully.
If OpenGL::EGL exists, then ok.
Otherwise, since OpenGL_EGL_FOUND is true, it adds ${OPENGL_egl_LIBRARY} as last resort solution.
This is the content of CMakeCache.txt about that variable:
//Path to a file.
OPENGL_EGL_INCLUDE_DIR:PATH=/usr/include
//Path to a library.
OPENGL_egl_LIBRARY:FILEPATH=/usr/lib/libEGL.dll.a
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Sorry, I have no idea why wouldn't OpenGL::EGL be set, hopefully @MaartenBent could give his opinion. I'm all for fixing this, but it seems really weird to have 2 different ways of adding a dependent library and while I wish I could explain it as just yet another CMake weirdness, I have a feeling that it might be rather due to my own ignorance and not a problem with CMake.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I checked FindOpenGL.cmake and the only path I could find for this behaviour is when OpenGL library is not found, and EGL library is found. Something do to with GLVND.
I'm fine with applying the suggested patch. Maybe with a comment that this is needed for Cygwin.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks for the confirmation! Will merge soon.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I checked
FindOpenGL.cmakeand the only path I could find for this behaviour is whenOpenGLlibrary is not found, andEGLlibrary is found. Something do to with GLVND. I'm fine with applying the suggested patch. Maybe with a comment that this is needed for Cygwin.
On my system, by searching for installed packages, I have installed this:

If you would like that I do more tests for getting additional information, I can do them if you give me some instructions,
Thank you very much for your support.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #23673 as completed via 590cd0b.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()