diff --git a/CMake/Backends.cmake b/CMake/Backends.cmake index 594445873..1c191f548 100644 --- a/CMake/Backends.cmake +++ b/CMake/Backends.cmake @@ -21,7 +21,7 @@ target_sources(rmlui_backend_Win32_GL2 INTERFACE "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Renderer_GL2.h" "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Include_Windows.h" ) -target_link_libraries(rmlui_backend_Win32_GL2 INTERFACE rmlui_backend_common_headers OpenGL::GL) +target_link_libraries(rmlui_backend_Win32_GL2 INTERFACE rmlui_backend_common_headers OpenGL::OpenGL OpenGL::EGL) add_library(rmlui_backend_Win32_VK INTERFACE) target_sources(rmlui_backend_Win32_VK INTERFACE @@ -50,7 +50,7 @@ target_sources(rmlui_backend_X11_GL2 INTERFACE # be substituted by "X11:X11" in addition to any of the other imported that might # be required. More info: # https://cmake.org/cmake/help/latest/module/FindX11.html -target_link_libraries(rmlui_backend_X11_GL2 INTERFACE rmlui_backend_common_headers OpenGL::GL ${X11_LIBRARIES}) +target_link_libraries(rmlui_backend_X11_GL2 INTERFACE rmlui_backend_common_headers OpenGL::OpenGL OpenGL::EGL ${X11_LIBRARIES}) add_library(rmlui_backend_SDL_GL2 INTERFACE) target_sources(rmlui_backend_SDL_GL2 INTERFACE @@ -60,7 +60,7 @@ target_sources(rmlui_backend_SDL_GL2 INTERFACE "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Platform_SDL.h" "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Renderer_GL2.h" ) -target_link_libraries(rmlui_backend_SDL_GL2 INTERFACE rmlui_backend_common_headers OpenGL::GL SDL2::SDL2 GLEW::GLEW SDL2_image::SDL2_image) +target_link_libraries(rmlui_backend_SDL_GL2 INTERFACE rmlui_backend_common_headers OpenGL::OpenGL OpenGL::EGL SDL2::SDL2 GLEW::GLEW SDL2_image::SDL2_image) add_library(rmlui_backend_SDL_GL3 INTERFACE) target_sources(rmlui_backend_SDL_GL3 INTERFACE @@ -71,7 +71,7 @@ target_sources(rmlui_backend_SDL_GL3 INTERFACE "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Renderer_GL3.h" "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Include_GL3.h" ) -target_link_libraries(rmlui_backend_SDL_GL3 INTERFACE rmlui_backend_common_headers OpenGL::GL SDL2::SDL2 SDL2_image::SDL2_image) +target_link_libraries(rmlui_backend_SDL_GL3 INTERFACE rmlui_backend_common_headers OpenGL::OpenGL OpenGL::EGL SDL2::SDL2 SDL2_image::SDL2_image) if(UNIX) # The OpenGL 3 renderer implementation uses dlopen/dlclose # This is required in some UNIX and UNIX-like operating systems to load shared object files at runtime @@ -114,7 +114,7 @@ target_sources(rmlui_backend_SFML_GL2 INTERFACE "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Renderer_GL2.h" ) target_link_libraries(rmlui_backend_SFML_GL2 INTERFACE - rmlui_backend_common_headers OpenGL::GL rmlui_SFML_old_wrapper SFML::Graphics SFML::Window SFML::System + rmlui_backend_common_headers OpenGL::OpenGL OpenGL::EGL rmlui_SFML_old_wrapper SFML::Graphics SFML::Window SFML::System ) if(WIN32) target_link_libraries(rmlui_backend_SFML_GL2 INTERFACE SFML::Main) @@ -128,7 +128,7 @@ target_sources(rmlui_backend_GLFW_GL2 INTERFACE "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Platform_GLFW.h" "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Renderer_GL2.h" ) -target_link_libraries(rmlui_backend_GLFW_GL2 INTERFACE rmlui_backend_common_headers OpenGL::GL glfw) +target_link_libraries(rmlui_backend_GLFW_GL2 INTERFACE rmlui_backend_common_headers OpenGL::OpenGL OpenGL::EGL glfw) add_library(rmlui_backend_GLFW_GL3 INTERFACE) target_sources(rmlui_backend_GLFW_GL3 INTERFACE @@ -139,7 +139,7 @@ target_sources(rmlui_backend_GLFW_GL3 INTERFACE "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Renderer_GL3.h" "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Include_GL3.h" ) -target_link_libraries(rmlui_backend_GLFW_GL3 INTERFACE rmlui_backend_common_headers OpenGL::GL glfw) +target_link_libraries(rmlui_backend_GLFW_GL3 INTERFACE rmlui_backend_common_headers OpenGL::OpenGL OpenGL::EGL glfw) if(UNIX) # The OpenGL 3 renderer implementation uses dlopen/dlclose # This is required in some UNIX and UNIX-like operating systems to load shared object files at runtime diff --git a/CMake/BackendsDependencies.cmake b/CMake/BackendsDependencies.cmake index 0ab8a8b49..25f88f23e 100644 --- a/CMake/BackendsDependencies.cmake +++ b/CMake/BackendsDependencies.cmake @@ -197,16 +197,16 @@ endif() # OpenGL handling changes in CMake 3.11, requiring to set CMake policy CMP0072 # More info: https://cmake.org/cmake/help/latest/policy/CMP0072.html if(RMLUI_SAMPLES_BACKEND MATCHES "GL2$") - find_package("OpenGL" "2") + find_package("OpenGL" "2" COMPONENTS "OpenGL" "EGL") if(NOT TARGET OpenGL::GL) - report_not_found_dependency("OpenGL" OpenGL::GL) + report_not_found_dependency("OpenGL" OpenGL::OpenGL) endif() endif() if(RMLUI_SAMPLES_BACKEND MATCHES "GL3$") - find_package("OpenGL" "3") + find_package("OpenGL" "3" COMPONENTS "OpenGL" "EGL") if(NOT TARGET OpenGL::GL) - report_not_found_dependency("OpenGL" OpenGL::GL) + report_not_found_dependency("OpenGL" OpenGL::OpenGL) endif() endif()