summaryrefslogtreecommitdiff
path: root/cmake/FindWrapOpenGL.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindWrapOpenGL.cmake')
-rw-r--r--cmake/FindWrapOpenGL.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/FindWrapOpenGL.cmake b/cmake/FindWrapOpenGL.cmake
new file mode 100644
index 0000000000..b3c60ba953
--- /dev/null
+++ b/cmake/FindWrapOpenGL.cmake
@@ -0,0 +1,20 @@
+
+# Logic derived from mkspecs/features/unix/opengl.prf: prefer GLESv2 over GL
+
+if(TARGET WrapOpenGL)
+ set(WrapOpenGL_FOUND ON)
+ return()
+endif()
+
+add_library(WrapOpenGL INTERFACE IMPORTED)
+
+if(QT_FEATURE_opengles2)
+ find_package(GLESv2)
+ target_link_libraries(WrapOpenGL INTERFACE GLESv2::GLESv2)
+else()
+ find_package(OpenGL)
+ target_link_libraries(WrapOpenGL INTERFACE OpenGL::GL)
+endif()
+set(WrapOpenGL_FOUND ON)
+
+set_property(TARGET WrapOpenGL PROPERTY IMPORTED_GLOBAL TRUE)