cmake refuses to find EGL without glvnd, which alpine does not use yet diff --git a/deps/glad/CMakeLists.txt b/deps/glad/CMakeLists.txt index ccfca1c..65c591e 100644 --- a/deps/glad/CMakeLists.txt +++ b/deps/glad/CMakeLists.txt @@ -18,11 +18,9 @@ target_link_libraries(obsglad PUBLIC OpenGL::GL) if(OS_WINDOWS) target_sources(obsglad PRIVATE src/glad_wgl.c include/glad/glad_wgl.h) elseif(OS_LINUX OR OS_FREEBSD) - if(TARGET OpenGL::EGL) - target_sources(obsglad PRIVATE src/glad_egl.c include/EGL/eglplatform.h include/glad/glad_egl.h) + target_sources(obsglad PRIVATE src/glad_egl.c include/EGL/eglplatform.h include/glad/glad_egl.h) - target_link_libraries(obsglad PRIVATE OpenGL::EGL) - endif() + target_link_libraries(obsglad PRIVATE OpenGL::EGL) endif() set_target_properties(obsglad PROPERTIES FOLDER deps POSITION_INDEPENDENT_CODE TRUE) diff --git a/libobs-opengl/CMakeLists.txt b/libobs-opengl/CMakeLists.txt index 641f5cc..62cb164 100644 --- a/libobs-opengl/CMakeLists.txt +++ b/libobs-opengl/CMakeLists.txt @@ -52,10 +52,9 @@ elseif(OS_LINUX OR OS_FREEBSD) target_link_libraries(libobs-opengl PRIVATE xcb::xcb X11::x11-xcb) if(ENABLE_WAYLAND) - find_package( - OpenGL - COMPONENTS EGL - REQUIRED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(EGL REQUIRED egl IMPORTED_TARGET GLOBAL) + add_library(OpenGL::EGL ALIAS PkgConfig::EGL) find_package(Wayland REQUIRED) diff --git a/libobs-opengl/cmake/legacy.cmake b/libobs-opengl/cmake/legacy.cmake index f540876..33b29db 100644 --- a/libobs-opengl/cmake/legacy.cmake +++ b/libobs-opengl/cmake/legacy.cmake @@ -56,10 +56,9 @@ elseif(OS_POSIX) set_target_properties(libobs-opengl PROPERTIES PREFIX "") if(ENABLE_WAYLAND) - find_package( - OpenGL - COMPONENTS EGL - REQUIRED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(EGL REQUIRED egl IMPORTED_TARGET GLOBAL) + add_library(OpenGL::EGL ALIAS PkgConfig::EGL) find_package(Wayland REQUIRED) target_sources(libobs-opengl PRIVATE gl-wayland-egl.c)