Skip to content

Commit

Permalink
Use EGL find module from ECM
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Aug 18, 2023
1 parent 6e1eb44 commit 4edaf1b
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 40 deletions.
8 changes: 0 additions & 8 deletions cmake/FindEGL.cmake

This file was deleted.

53 changes: 31 additions & 22 deletions features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# SPDX-License-Identifier: BSD-3-Clause

## Find EGL:
find_package(EGL QUIET)

## Find Vulkan:
find_package(Vulkan QUIET)

Expand Down Expand Up @@ -83,7 +80,9 @@ set(LIRI_FEATURE_aurora_xkbcommon "$<IF:${FEATURE_aurora_xkbcommon},1,0>")
# brcm
option(FEATURE_aurora_brcm "Raspberry Pi" ON)
if(FEATURE_aurora_brcm)
if(NOT TARGET PkgConfig::EGL)
find_package(EGL QUIET)

if(NOT TARGET EGL::EGL)
message(WARNING "You need EGL for Aurora::Brcm")
endif()
set(FEATURE_aurora_brcm OFF)
Expand All @@ -94,7 +93,7 @@ if(FEATURE_aurora_brcm)
LABEL
"Broadcom EGL (Raspberry Pi)"
LIBRARIES
PkgConfig::EGL
EGL::EGL
CODE "
#include <EGL/egl.h>
#include <bcm_host.h>
Expand Down Expand Up @@ -126,9 +125,11 @@ set(LIRI_FEATURE_aurora_compositor_quick "$<IF:${FEATURE_aurora_compositor_quick
# dmabuf-client-buffer
option(FEATURE_aurora_dmabuf_client_buffer "Linux dma-buf client buffer integration" ON)
if(FEATURE_aurora_dmabuf_client_buffer)
find_package(EGL QUIET)
find_package(Qt${QT_MAJOR_VERSION}EglSupport QUIET)
if(NOT TARGET PkgConfig::EGL OR NOT TARGET PkgConfig::Libdrm OR NOT TARGET Qt::OpenGL OR NOT TARGET Qt${QT_MAJOR_VERSION}EglSupport::Qt${QT_MAJOR_VERSION}EglSupport)
if(NOT TARGET PkgConfig::EGL)

if(NOT TARGET EGL::EGL OR NOT TARGET PkgConfig::Libdrm OR NOT TARGET Qt::OpenGL OR NOT TARGET Qt${QT_MAJOR_VERSION}EglSupport::Qt${QT_MAJOR_VERSION}EglSupport)
if(NOT TARGET EGL::EGL)
message(WARNING "You need EGL for Aurora::DmabufClientBuffer")
endif()
if(NOT TARGET PkgConfig::Libdrm)
Expand All @@ -149,7 +150,7 @@ if(FEATURE_aurora_dmabuf_client_buffer)
LABEL
"Linux client dma-buf buffer sharing"
LIBRARIES
PkgConfig::EGL
EGL::EGL
PkgConfig::Libdrm
CODE "
#include <EGL/egl.h>
Expand Down Expand Up @@ -180,8 +181,10 @@ set(LIRI_FEATURE_aurora_dmabuf_client_buffer "$<IF:${FEATURE_aurora_dmabuf_clien
# dmabuf-server-buffer
option(FEATURE_aurora_dmabuf_server_buffer "Linux dma-buf server buffer integration" ON)
if(FEATURE_aurora_dmabuf_server_buffer)
if(NOT TARGET PkgConfig::EGL OR NOT TARGET PkgConfig::Libdrm OR NOT TARGET Qt::OpenGL)
if(NOT TARGET PkgConfig::EGL)
find_package(EGL QUIET)

if(NOT TARGET EGL::EGL OR NOT TARGET PkgConfig::Libdrm OR NOT TARGET Qt::OpenGL)
if(NOT TARGET EGL::EGL)
message(WARNING "You need EGL for Aurora::DmabufServerBuffer")
endif()
if(NOT TARGET PkgConfig::Libdrm)
Expand All @@ -199,7 +202,7 @@ if(FEATURE_aurora_dmabuf_server_buffer)
LABEL
"Linux dma-buf Buffer Sharing"
LIBRARIES
PkgConfig::EGL
EGL::EGL
PkgConfig::Libdrm
CODE "
#include <EGL/egl.h>
Expand Down Expand Up @@ -232,10 +235,10 @@ set(LIRI_FEATURE_aurora_drm_atomic "$<IF:${FEATURE_aurora_drm_atomic},1,0>")
# drm-egl-server-buffer
option(FEATURE_aurora_drm_egl_server_buffer "DRM EGL" ON)
if(FEATURE_aurora_drm_egl_server_buffer)
if(NOT TARGET PkgConfig::EGL)
if(NOT TARGET PkgConfig::EGL)
message(WARNING "You need EGL for Aurora::DrmEglServerBuffer")
endif()
find_package(EGL QUIET)

if(NOT TARGET EGL::EGL)
message(WARNING "You need EGL for Aurora::DrmEglServerBuffer")
set(FEATURE_aurora_drm_egl_server_buffer OFF)
endif()
endif()
Expand All @@ -245,7 +248,7 @@ if(FEATURE_aurora_drm_egl_server_buffer)
LABEL
"DRM EGL Server"
LIBRARIES
PkgConfig::EGL
EGL::EGL
CODE "
#include <EGL/egl.h>
#include <EGL/eglext.h>
Expand All @@ -271,10 +274,12 @@ set(LIRI_FEATURE_aurora_drm_egl_server_buffer "$<IF:${FEATURE_aurora_drm_egl_ser
# wayland-egl
option(FEATURE_aurora_wayland_egl "Wayland EGL" ON)
if(FEATURE_aurora_wayland_egl)
find_package(EGL QUIET)
find_package(Wayland "${WAYLAND_MIN_VERSION}" COMPONENTS Egl QUIET)
find_package(Qt${QT_MAJOR_VERSION}EglSupport QUIET)
if(NOT TARGET PkgConfig::EGL OR NOT TARGET Wayland::Egl OR NOT TARGET Qt::OpenGL OR NOT TARGET Qt${QT_MAJOR_VERSION}EglSupport::Qt${QT_MAJOR_VERSION}EglSupport)
if(NOT TARGET PkgConfig::EGL)

if(NOT TARGET EGL::EGL OR NOT TARGET Wayland::Egl OR NOT TARGET Qt::OpenGL OR NOT TARGET Qt${QT_MAJOR_VERSION}EglSupport::Qt${QT_MAJOR_VERSION}EglSupport)
if(NOT TARGET EGL::EGL)
message(WARNING "You need EGL for Aurora::WaylandEgl")
endif()
if(NOT TARGET Wayland::Egl)
Expand All @@ -295,8 +300,10 @@ set(LIRI_FEATURE_aurora_wayland_egl "$<IF:${FEATURE_aurora_wayland_egl},1,0>")
# libhybris-egl-server-buffer
option(FEATURE_aurora_libhybris_egl_server_buffer "libhybris EGL" ON)
if(FEATURE_aurora_libhybris_egl_server_buffer)
if(NOT TARGET PkgConfig::EGL OR NOT TARGET Qt::OpenGL)
if(NOT TARGET PkgConfig::EGL)
find_package(EGL QUIET)

if(NOT TARGET EGL::EGL OR NOT TARGET Qt::OpenGL)
if(NOT TARGET EGL::EGL)
message(WARNING "You need EGL for Aurora::LibhybrisEgl")
endif()
if(NOT TARGET Qt::OpenGL)
Expand All @@ -311,7 +318,7 @@ if(FEATURE_aurora_libhybris_egl_server_buffer)
LABEL
"libhybris EGL Server"
LIBRARIES
PkgConfig::EGL
EGL::EGL
CODE "
#include <EGL/egl.h>
#include <EGL/eglext.h>
Expand All @@ -338,7 +345,9 @@ set(LIRI_FEATURE_aurora_libhybris_egl_server_buffer "$<IF:${FEATURE_aurora_libhy
# qpa
option(FEATURE_aurora_qpa "Qt platform plugin for Wayland compositors" ON)
if(FEATURE_aurora_qpa)
if(NOT TARGET PkgConfig::EGL)
find_package(EGL QUIET)

if(NOT TARGET EGL::EGL)
message(WARNING "You need EGL for Aurora::QPA")
set(FEATURE_aurora_qpa OFF)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ liri_add_plugin(AuroraDmaBufServerBufferIntegrationPlugin
INCLUDE_DIRECTORIES
../../../../hardwareintegration/compositor/dmabuf-server
LIBRARIES
PkgConfig::EGL
EGL::EGL
PkgConfig::Libdrm
Wayland::Server
Qt::CorePrivate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ liri_add_plugin(AuroraDrmEglServerBufferIntegrationPlugin
INCLUDE_DIRECTORIES
../../../../hardwareintegration/compositor/drm-egl-server
LIBRARIES
PkgConfig::EGL
EGL::EGL
Wayland::Server
Qt::CorePrivate
Qt::GuiPrivate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ liri_add_plugin(AuroraLibHybrisEglServerBufferIntegrationPlugin
INCLUDE_DIRECTORIES
../../../../hardwareintegration/compositor/libhybris-egl-server
LIBRARIES
PkgConfig::EGL
EGL::EGL
Wayland::Server
PUBLIC_LIBRARIES
Qt::CorePrivate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ liri_add_plugin(AuroraDmabufClientBufferIntegrationPlugin
INCLUDE_DIRECTORIES
../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1
LIBRARIES
PkgConfig::EGL
EGL::EGL
PkgConfig::Libdrm
Wayland::Server
Qt::CorePrivate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ liri_add_plugin(AuroraWaylandEglClientBufferIntegrationPlugin
INCLUDE_DIRECTORIES
../../../../hardwareintegration/compositor/wayland-egl
LIBRARIES
PkgConfig::EGL
EGL::EGL
Wayland::Egl
Wayland::Server
Qt5EglSupport::Qt5EglSupport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ liri_add_plugin(AuroraWaylandEglStreamClientBufferIntegrationPlugin
INCLUDE_DIRECTORIES
../../../../hardwareintegration/compositor/wayland-eglstream-controller
LIBRARIES
PkgConfig::EGL
EGL::EGL
Wayland::Egl
Wayland::Server
Qt::CorePrivate
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/platforms/eglfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ liri_add_module(EglFSDeviceIntegration
Liri::AuroraPlatformHeaders
Liri::AuroraUdev
Liri::AuroraLogind
PkgConfig::EGL
EGL::EGL
EXPORT_IMPORT_CONDITION
QT_BUILD_EGL_DEVICE_LIB
NO_CMAKE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ liri_add_plugin(eglfs-kms-integration
Liri::EglFSDeviceIntegrationPrivate
Liri::EglFSKmsSupport
Liri::EglFSKmsSupportPrivate
PkgConfig::EGL
EGL::EGL
)

liri_extend_target(eglfs-kms-integration CONDITION FEATURE_aurora_drm_atomic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ liri_add_plugin(eglfs-kms-egldevice-integration
Liri::EglFSDeviceIntegrationPrivate
Liri::EglFSKmsSupport
Liri::EglFSKmsSupportPrivate
PkgConfig::EGL
EGL::EGL
)

liri_extend_target(eglfs-kms-egldevice-integration CONDITION FEATURE_aurora_drm_atomic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ liri_add_module(EglFSKmsSupport
Liri::AuroraKmsSupportPrivate
PkgConfig::Libdrm
PkgConfig::Gbm
PkgConfig::EGL
EGL::EGL
NO_CMAKE
NO_PKGCONFIG
)
Expand Down

0 comments on commit 4edaf1b

Please sign in to comment.