summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase/0006-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch
blob: eaa5da84314c07f87698ecce140f64c8d16202dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 515acdcfe158982f31b31e410bbedb3db94bea1c Mon Sep 17 00:00:00 2001
From: Pascal Bach <pascal.bach@siemens.com>
Date: Wed, 11 May 2016 15:20:41 +0200
Subject: [PATCH] Pretend Qt5 wasn't found if OE_QMAKE_PATH_EXTERNAL_HOST_BINS
 isn't set

This prevents errors like:

|   The imported target "Qt5::Core" references the file
|
|      "/qmake"
|
|   but this file does not exist.  Possible reasons include:

Which happen if CMake is used without setting OE_QMAKE_PATH_EXTERNAL_HOST_BINS.
To achieve this a check for OE_QMAKE_PATH_EXTERNAL_HOST_BINS is added to each Qt5*Config.cmake
file. And in the case where the variable is not set we just return which is basically
equal to telling CMake that Qt5 wasn't found.

Upstream-Status: Pending
  The patch only makes sense in connection with other patches included here.
  Specifically this are:
    - 0003-Add-external-hostbindir-option.patch
    - 0010-Add-external-hostbindir-option-for-native-sdk.patch

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
---
 mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 5 +++++
 src/corelib/Qt5Config.cmake.in                      | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 55c74aad66..f9ec328c83 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -9,6 +9,11 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0)
 endif()
 !!ENDIF
 
+if(NOT DEFINED OE_QMAKE_PATH_EXTERNAL_HOST_BINS)
+    message(WARNING "Skipping because OE_QMAKE_PATH_EXTERNAL_HOST_BINS is not defined")
+    return()
+endif()
+
 !!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
 !!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
 set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
diff --git a/src/corelib/Qt5Config.cmake.in b/src/corelib/Qt5Config.cmake.in
index 75b53485b7..ed31888c93 100644
--- a/src/corelib/Qt5Config.cmake.in
+++ b/src/corelib/Qt5Config.cmake.in
@@ -3,6 +3,11 @@ if (CMAKE_VERSION VERSION_LESS 2.8.9)
     message(FATAL_ERROR \"Qt5 requires at least CMake version 2.8.9\")
 endif()
 
+if(NOT DEFINED OE_QMAKE_PATH_EXTERNAL_HOST_BINS)
+    message(WARNING "Skipping because OE_QMAKE_PATH_EXTERNAL_HOST_BINS is not defined")
+    return()
+endif()
+
 if (NOT Qt5_FIND_COMPONENTS)
     set(Qt5_NOT_FOUND_MESSAGE \"The Qt5 package requires at least one component\")
     set(Qt5_FOUND False)