From fc5e538787439c32004e5b0b14e5cd905a19b052 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 10 Apr 2022 20:20:04 +0300 Subject: [PATCH] kinfocenter: opengl module does not require OpenGLES Signed-off-by: Ivailo Monev --- CMakeLists.txt | 8 ------- appveyor.yml | 2 +- kinfocenter/Modules/CMakeLists.txt | 4 ++-- kinfocenter/Modules/opengl/CMakeLists.txt | 28 ++++++++++++------------- kinfocenter/Modules/opengl/opengl.cpp | 11 +++++----- kinfocenter/Modules/opengl/openglconfig.h.cmake | 2 +- 6 files changed, 23 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fc32284..19f65e47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,14 +98,6 @@ set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL ) -macro_optional_find_package(OpenGLES) -set_package_properties(OpenGLES PROPERTIES - DESCRIPTION "The OpenGLES libraries" - URL "http://www.khronos.org/opengles" - TYPE OPTIONAL - PURPOSE "OpenGL ES info module" -) - macro_optional_find_package(LibDRM) set_package_properties(LibDRM PROPERTIES DESCRIPTION "Userspace interface to kernel DRM services" diff --git a/appveyor.yml b/appveyor.yml index 9c99841e..10599a9b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,7 +25,7 @@ build_script: libxcb-sync-dev libxcb-render-util0-dev libxcb-keysyms1-dev \ libglu1-mesa-dev mesa-common-dev libmtp-dev libusb-1.0-0-dev libssh-dev \ libsmbclient-dev libdrm-dev libraw1394-dev libsensors4-dev \ - libgles2-mesa-dev libpam0g-dev libpci-dev libopenexr-dev \ + libegl-dev libpam0g-dev libpci-dev libopenexr-dev \ liblzma-dev libbz2-dev libgphoto2-dev liblightdm-gobject-1-dev \ libgeoclue-2-dev libdbusmenu-katie ccache diff --git a/kinfocenter/Modules/CMakeLists.txt b/kinfocenter/Modules/CMakeLists.txt index a19b6f91..90d6a110 100644 --- a/kinfocenter/Modules/CMakeLists.txt +++ b/kinfocenter/Modules/CMakeLists.txt @@ -8,10 +8,10 @@ add_subdirectory( samba ) add_subdirectory( nics ) add_feature_info("OpenGL support" OPENGL_FOUND "View OpenGL details in kinfocenter." ) -add_feature_info("OpenGL/ES support" OPENGLES_FOUND "View OpenGL ES2.0 details in kinfocenter." ) +add_feature_info("EGL support" OpenGL_EGL_FOUND "View EGL details in kinfocenter." ) add_feature_info("DRM support" LIBDRM_FOUND "View 3D acceleration details in kinfocenter." ) -if((OPENGL_FOUND AND OPENGL_GLU_FOUND) OR OPENGLES_FOUND) +if((OPENGL_FOUND AND OPENGL_GLU_FOUND) OR OpenGL_EGL_FOUND) add_subdirectory( opengl ) else() message(STATUS "OpenGL/ES2.0 information module has been disabled.") diff --git a/kinfocenter/Modules/opengl/CMakeLists.txt b/kinfocenter/Modules/opengl/CMakeLists.txt index 1a26c7ab..5593463c 100644 --- a/kinfocenter/Modules/opengl/CMakeLists.txt +++ b/kinfocenter/Modules/opengl/CMakeLists.txt @@ -1,16 +1,16 @@ -if(OPENGL_FOUND AND OPENGL_GLU_FOUND) - set(KCM_ENABLE_OPENGL TRUE) - include_directories(${OPENGL_INCLUDE_DIR} ${OPENGL_GLU_INCLUDE_DIR}) -endif() - if(LIBDRM_FOUND) set(KCM_ENABLE_DRM TRUE) include_directories(${LIBDRM_INCLUDE_DIR}) endif() -if(OPENGLES_FOUND) - set(KCM_ENABLE_OPENGLES TRUE) - include_directories(${OPENGLES_INCLUDE_DIR}) +if(OPENGL_FOUND AND OPENGL_GLU_FOUND) + set(KCM_ENABLE_OPENGL TRUE) + include_directories(${OPENGL_INCLUDE_DIR} ${OPENGL_GLU_INCLUDE_DIR}) +endif() + +if(OpenGL_EGL_FOUND) + set(KCM_ENABLE_EGL TRUE) + include_directories(${OPENGL_EGL_INCLUDE_DIRS}) endif() ########### next target ############### @@ -19,16 +19,16 @@ kde4_add_plugin(kcm_opengl opengl.cpp) target_link_libraries(kcm_opengl ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${X11_X11_LIB}) -if(OPENGL_FOUND AND OPENGL_GLU_FOUND) - target_link_libraries(kcm_opengl ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) -endif() - if(LIBDRM_FOUND) target_link_libraries(kcm_opengl ${LIBDRM_LIBRARIES}) endif() -if(OPENGLES_FOUND) - target_link_libraries(kcm_opengl ${OPENGLES_LIBRARIES}) +if(OPENGL_FOUND AND OPENGL_GLU_FOUND) + target_link_libraries(kcm_opengl ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) +endif() + +if(OpenGL_EGL_FOUND) + target_link_libraries(kcm_opengl ${OPENGL_egl_LIBRARY}) endif() configure_file(openglconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/openglconfig.h) diff --git a/kinfocenter/Modules/opengl/opengl.cpp b/kinfocenter/Modules/opengl/opengl.cpp index d92b35c0..5268f233 100644 --- a/kinfocenter/Modules/opengl/opengl.cpp +++ b/kinfocenter/Modules/opengl/opengl.cpp @@ -53,9 +53,8 @@ #include #endif -#ifdef KCM_ENABLE_OPENGLES +#ifdef KCM_ENABLE_EGL #include -#include #endif #include "moc_opengl.cpp" @@ -155,7 +154,7 @@ static struct { const char *glVersion; const char *glExtensions; #endif -#ifdef KCM_ENABLE_OPENGLES +#ifdef KCM_ENABLE_EGL const char *eglVendor; const char *eglVersion; const char *eglExtensions; @@ -665,7 +664,7 @@ static QTreeWidgetItem *get_gl_info(Display *dpy, QTreeWidgetItem *l1, QTreeWidg } #endif // KCM_ENABLE_OPENGL -#ifdef KCM_ENABLE_OPENGLES +#ifdef KCM_ENABLE_EGL QTreeWidgetItem *print_egl(QTreeWidgetItem *l1, QTreeWidgetItem *l2) { QTreeWidgetItem *l3; @@ -707,7 +706,7 @@ static QTreeWidgetItem *get_egl_info(Display *dpy, QTreeWidgetItem *l1, QTreeWid eglTerminate(egl_dpy); return result; } -#endif // KCM_ENABLE_OPENGLES +#endif // KCM_ENABLE_EGL bool GetInfo_OpenGL(QTreeWidget *treeWidget) { @@ -749,7 +748,7 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget) if (l2) l2->setExpanded(true); -#ifdef KCM_ENABLE_OPENGLES +#ifdef KCM_ENABLE_EGL l2 = get_egl_info(dpy, l1, l2); if (!l2) KMessageBox::error(0, i18n("Could not initialize OpenGL ES2.0")); diff --git a/kinfocenter/Modules/opengl/openglconfig.h.cmake b/kinfocenter/Modules/opengl/openglconfig.h.cmake index c691895b..815474ad 100644 --- a/kinfocenter/Modules/opengl/openglconfig.h.cmake +++ b/kinfocenter/Modules/opengl/openglconfig.h.cmake @@ -24,6 +24,6 @@ #cmakedefine KCM_ENABLE_DRM #cmakedefine KCM_ENABLE_OPENGL -#cmakedefine KCM_ENABLE_OPENGLES +#cmakedefine KCM_ENABLE_EGL #endif -- 2.11.0