File 0001-CMake-allow-disabling-QtOpenGL-without-disabling-Ope.patch of Package qt6-base
From c50692e7460b623f6a2707469b7169c0fbc78229 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Wed, 20 Mar 2024 11:11:44 -0700
Subject: [PATCH] CMake: allow disabling QtOpenGL without disabling OpenGL in
QtGui
I may not want that library but still want QtGui to be fully-featured.
Pick-to: 6.7
Change-Id: I5f663c2f9f4149af84fefffd17be8b834daa9212
---
configure.cmake | 6 ++++++
src/CMakeLists.txt | 4 ++--
src/plugins/platforms/eglfs/CMakeLists.txt | 2 +-
src/plugins/platforms/minimalegl/CMakeLists.txt | 2 +-
.../auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt | 2 +-
tests/baseline/painting/CMakeLists.txt | 2 +-
6 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/configure.cmake b/configure.cmake
index c4338fa7e94..90550516447 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1096,6 +1096,12 @@ qt_feature("network" PRIVATE
SECTION "Module"
PURPOSE "Provides the Qt Network module."
)
+qt_feature("opengl_module" PRIVATE # FEATURE_opengl is already taken
+ LABEL "Qt OpenGL"
+ CONDITION QT_FEATURE_gui # AND QT_FEATURE_opengl but that is in src/gui/configure.cmake
+ SECTION "Module"
+ PURPOSE "Provides the Qt OpenGL module."
+)
qt_feature("printsupport" PRIVATE
LABEL "Qt PrintSupport"
CONDITION QT_FEATURE_widgets
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index afcdd1f463e..7fa04f099d6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -73,13 +73,13 @@ if(QT_FEATURE_gui)
add_subdirectory(gui)
add_subdirectory(assets)
- if(QT_FEATURE_opengl)
+ if(QT_FEATURE_opengl AND QT_FEATURE_opengl_module)
add_subdirectory(opengl)
endif()
if(QT_FEATURE_widgets)
add_subdirectory(widgets)
- if(QT_FEATURE_opengl)
+ if(QT_FEATURE_opengl AND QT_FEATURE_opengl_module)
add_subdirectory(openglwidgets)
endif()
endif()
diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt
index 7c53dae667c..54518afea58 100644
--- a/src/plugins/platforms/eglfs/CMakeLists.txt
+++ b/src/plugins/platforms/eglfs/CMakeLists.txt
@@ -63,7 +63,7 @@ qt_internal_extend_target(EglFSDeviceIntegrationPrivate
PlatformGraphics::PlatformGraphics
)
-qt_internal_extend_target(EglFSDeviceIntegrationPrivate CONDITION QT_FEATURE_opengl
+qt_internal_extend_target(EglFSDeviceIntegrationPrivate CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengl_module
SOURCES
api/qeglfscontext.cpp api/qeglfscontext_p.h
api/qeglfscursor.cpp api/qeglfscursor_p.h
diff --git a/src/plugins/platforms/minimalegl/CMakeLists.txt b/src/plugins/platforms/minimalegl/CMakeLists.txt
index b93f325b8fc..fd259056cd7 100644
--- a/src/plugins/platforms/minimalegl/CMakeLists.txt
+++ b/src/plugins/platforms/minimalegl/CMakeLists.txt
@@ -29,7 +29,7 @@ qt_internal_add_plugin(QMinimalEglIntegrationPlugin
## Scopes:
#####################################################################
-qt_internal_extend_target(QMinimalEglIntegrationPlugin CONDITION QT_FEATURE_opengl
+qt_internal_extend_target(QMinimalEglIntegrationPlugin CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengl_module
SOURCES
qminimaleglbackingstore.cpp qminimaleglbackingstore.h
LIBRARIES
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt
index 7dfc6014840..ffdcb9f008b 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt
@@ -28,7 +28,7 @@ qt_internal_add_test(tst_qgraphicsview
## Scopes:
#####################################################################
-qt_internal_extend_target(tst_qgraphicsview CONDITION QT_FEATURE_opengl
+qt_internal_extend_target(tst_qgraphicsview CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengl_module
LIBRARIES
Qt::OpenGL
Qt::OpenGLWidgets
diff --git a/tests/baseline/painting/CMakeLists.txt b/tests/baseline/painting/CMakeLists.txt
index 86dc752186b..26ae6a395b9 100644
--- a/tests/baseline/painting/CMakeLists.txt
+++ b/tests/baseline/painting/CMakeLists.txt
@@ -78,7 +78,7 @@ qt_internal_add_resource(tst_baseline_painting "images"
## Scopes:
#####################################################################
-qt_internal_extend_target(tst_baseline_painting CONDITION QT_FEATURE_opengl
+qt_internal_extend_target(tst_baseline_painting CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengl_module
LIBRARIES
Qt::OpenGL
)
--
2.47.1