summaryrefslogtreecommitdiff
path: root/platform/qt/qt5.cmake
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-10-19 16:02:25 -0700
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-10-25 18:08:28 +0300
commitf7426a4253e2157ee5e98d86afde9cd293a25b5b (patch)
tree34e67978d1ee2560720388343abc476526b8cae7 /platform/qt/qt5.cmake
parent9d87dc8cf17f00eb6a8aadc0612972d63dd7f6e3 (diff)
downloadqtlocation-mapboxgl-f7426a4253e2157ee5e98d86afde9cd293a25b5b.tar.gz
[Qt] Use QOpenGLFunctions for Qt5
Do not link directly with OpenGL, so we load it using Qt5. Also, always build for OpenGL ES2 which is the compatibilty mode that should work on all platforms supported by Qt5.
Diffstat (limited to 'platform/qt/qt5.cmake')
-rw-r--r--platform/qt/qt5.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/qt/qt5.cmake b/platform/qt/qt5.cmake
index c4af774ba3..0c9a974b4b 100644
--- a/platform/qt/qt5.cmake
+++ b/platform/qt/qt5.cmake
@@ -5,6 +5,12 @@ find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Sql REQUIRED)
+# Qt5 always build OpenGL ES2 which is the compatibility
+# mode. Qt5 will take care of translating the desktop
+# version of OpenGL to ES2.
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBGL_USE_GLES2")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBGL_USE_GLES2")
+
set(MBGL_QT_CORE_LIBRARIES
PUBLIC Qt5::Core
PUBLIC Qt5::Gui