From f0cc730197a490afb7372c8122f2eccea85ba7d1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 3 Apr 2019 15:15:33 +0200 Subject: [PATCH] Fix FindWrapOpenGL to choose the correct GL implementation The find_package() call for WrapOpenGL was moved to the beginning of the src/gui project file. This was incorrect, because the features were not yet computed at that time, and the find module was incorrectly always choosing the Desktop GL implementation. Move the find_package() after the add_qt_module() call. Amends 4f736db08c43fdbe4cfea8da7bf12fac5a0ec6ce. Task-number: QTBUG-74133 Change-Id: Ice1da8f23275843c7285ec748e6d673edbffffac Reviewed-by: Tobias Hunger --- src/gui/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 6a8bdb2d31..b3d0f9fcb5 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,8 +1,6 @@ # special case: set(OpenGL_GL_PREFERENCE GLVND) -find_package(WrapOpenGL) # special case - ##################################################################### ## Gui Module: ##################################################################### @@ -441,6 +439,14 @@ extend_target(Gui CONDITION QT_FEATURE_draganddrop kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h ) +# With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf +# acted like WrapOpenGL: direct linkage against either libGLESv2 or +# libGL, depending on the opengl _feature_. This is done by hand now +# here (where the feature is available). +# DO NOT MOVE THIS TO THE BEGINNING OF THE FILE, the feature variables are not +# available until the add_qt_module call. +find_package(WrapOpenGL) # special case + extend_target(Gui CONDITION QT_FEATURE_opengl SOURCES kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h