summaryrefslogtreecommitdiffstats
path: root/src/gui/Qt5GuiConfigExtras.cmake.in
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2013-04-11 22:45:14 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-19 12:03:36 +0200
commita680fe609f9b8cbccee1acd7391a725cf4b7b523 (patch)
tree82a677238277d85d1efa37ec3c8fca027c09e90e /src/gui/Qt5GuiConfigExtras.cmake.in
parent5aa349628e2d4913e5aeddd6557d578f34e31fc0 (diff)
Add the GL headers to cmake variables.
If building angle ourselves, that's just the basic Qt include dir, and if using an external gl, look for it in the places specified in the mkspec. As the qopengl.h header includes the gl header, this is a 'public include dependency' of QtGui, so it is added to the relevant variable and the INTERFACE_INCLUDE_DIRECTORIES of Qt5::Gui. Change-Id: I8c2c1782e0a2600032771175444b087da28433fc Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/gui/Qt5GuiConfigExtras.cmake.in')
-rw-r--r--src/gui/Qt5GuiConfigExtras.cmake.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
new file mode 100644
index 0000000000..d9313d4364
--- /dev/null
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -0,0 +1,20 @@
+
+!!IF !contains(QT_CONFIG, angle)
+
+!!IF !isEmpty(CMAKE_GL_INCDIRS)
+
+find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME
+ PATHS $$CMAKE_GL_INCDIRS
+ NO_DEFAULT_PATH)
+if (NOT _qt5gui_OPENGL_INCLUDE_DIR)
+ message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\")
+endif()
+
+list(APPEND Qt5Gui_INCLUDE_DIRS ${_qt5gui_OPENGL_INCLUDE_DIR})
+set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR})
+
+unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE)
+
+!!ENDIF
+
+!!ENDIF