1From 0574975fb4a981568e69461c4df99767cc1faa72 Mon Sep 17 00:00:00 2001
2From: Max Krummenacher <max.krummenacher@toradex.com>
3Date: Sat, 27 Oct 2018 12:29:31 +0000
4Subject: [PATCH] Qt5GuiConfigExtras.cmake.in: cope with variable path to
5 sysroot
6
7EGL is configured to need an include path into the recipe-specific sysroot.
8However users of the cmake file will have a different absolute path than that
9used when creating the cmake file from cmake.in in qtbase.
10
11Change to store the relative path within the sysroot and then prepend the
12currently used sysroot in the _qt5gui_find_extra_libs macro.
13
14Upstream-Status: Inappropriate [OE specific]
15
16Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
17---
18 src/gui/Qt5GuiConfigExtras.cmake.in | 22 ++++++++--------------
19 1 file changed, 8 insertions(+), 14 deletions(-)
20
21diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
22index 84dbbfebd4..ad6956d814 100644
23--- a/src/gui/Qt5GuiConfigExtras.cmake.in
24+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
25@@ -75,21 +75,15 @@ unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE)
26
27 macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
28     set(Qt5Gui_${Name}_LIBRARIES)
29-!!IF !mac
30-    set(Qt5Gui_${Name}_INCLUDE_DIRS ${IncDirs})
31-!!ELSE
32+
33     foreach(_dir ${IncDirs})
34-      if (EXISTS ${_dir})
35-        list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_dir})
36-      else()
37-        find_path(_actual_dir ${_dir}) # Look in sdk directories
38-        if (_actual_dir)
39-          list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_actual_dir})
40-        endif()
41-        unset(_actual_dir CACHE)
42+      find_path(_actual_dir ${_dir})
43+      if (_actual_dir)
44+        list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_actual_dir})
45       endif()
46+      unset(_actual_dir CACHE)
47     endforeach()
48-!!ENDIF
49+
50     foreach(_lib ${Libs})
51         if (IS_ABSOLUTE ${_lib})
52             get_filename_component(_libFile ${_lib} NAME_WE)
53@@ -171,11 +165,11 @@ endmacro()
54
55
56 !!IF !isEmpty(CMAKE_EGL_LIBS)
57-_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$CMAKE_EGL_INCDIRS\")
58+_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$replace(CMAKE_EGL_INCDIRS,$$re_escape($$PKG_CONFIG_SYSROOT_DIR),)\")
59 !!ENDIF
60
61 !!IF !isEmpty(CMAKE_OPENGL_LIBS)
62-_qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\" \"$$CMAKE_OPENGL_INCDIRS\")
63+_qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\" \"$$replace(CMAKE_OPENGL_INCDIRS,$$re_escape($$PKG_CONFIG_SYSROOT_DIR),)\")
64
65 !!ENDIF
66
67