diff --git a/src/corelib/Qt6CTestMacros.cmake b/src/corelib/Qt6CTestMacros.cmake index 8722553cd0a..d40be5ac61d 100644 --- a/src/corelib/Qt6CTestMacros.cmake +++ b/src/corelib/Qt6CTestMacros.cmake @@ -116,6 +116,9 @@ function(_qt_internal_get_cmake_test_configure_options out_var) if (NO_WIDGETS) list(APPEND option_list "-DNO_WIDGETS=True") endif() + if (NO_OPENGL) + list(APPEND option_list "-DNO_OPENGL=True") + endif() if (NO_DBUS) list(APPEND option_list "-DNO_DBUS=True") endif() diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index ddc8e8f0481..58c89d0861a 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -109,6 +109,9 @@ endif() if(NOT TARGET Qt::Widgets) set(NO_WIDGETS TRUE) endif() +if(NOT TARGET Qt::OpenGL) + set(NO_OPENGL TRUE) +endif() include("${_Qt6CTestMacros}") @@ -282,11 +285,16 @@ endif() if (NOT NO_WIDGETS) list(APPEND qt_module_includes Widgets QWidget - OpenGL QOpenGLBuffer PrintSupport QPrinter ) endif() +if (NOT NO_OPENGL) + list(APPEND qt_module_includes + OpenGL QOpenGLBuffer + ) +endif() + if (NOT NO_DBUS) list(APPEND qt_module_includes DBus QDBusMessage @@ -298,7 +306,7 @@ _qt_internal_test_module_includes( ) _qt_internal_test_expect_pass(test_concurrent_module) -if(NOT NO_GUI) +if(NOT NO_GUI AND NOT NO_OPENGL) _qt_internal_test_expect_pass(test_opengl_lib) endif()