diff options
author | Pascal Bach <pascal.bach@siemens.com> | 2016-05-11 15:53:14 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-05-18 21:29:51 +0200 |
commit | 05103827d50ec218954dee3866ec40bee9ec59af (patch) | |
tree | bf48876ff246cbab26847f0548efe97a5e2914dd | |
parent | cbd9331b7acc9b1b53043077993f94bcb9e3f38a (diff) | |
download | meta-qt5-05103827d50ec218954dee3866ec40bee9ec59af.tar.gz |
qtbase: add patch to make Qt5Config modules behave better with cmake builds
Currently if a project if using the cmake bbclass and the CMakeLists.txt file
uses find_package to find Qt5 and error like this is produced:
| The imported target "Qt5::Core" references the file
|
| "/qmake"
|
| but this file does not exist. Possible reasons include:
This is because OE_QMAKE_PATH_EXTERNAL_HOST_BINS is only set in the cmake_qt5 bblcass.
To make it work better in that case the Qt5Config files check if OE_QMAKE_PATH_EXTERNAL_HOST_BINS
is defined and bail out if not. For CMake this is the same as Qt5 wasn't found.
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r-- | recipes-qt/qt5/qtbase/0011-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch | 67 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase_git.bb | 1 |
2 files changed, 68 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase/0011-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch b/recipes-qt/qt5/qtbase/0011-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch new file mode 100644 index 00000000..7a24459c --- /dev/null +++ b/recipes-qt/qt5/qtbase/0011-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From f5a949e17aa8b37491fbc414c38557c9920fa1e5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Pascal Bach <pascal.bach@siemens.com> | ||
3 | Date: Wed, 11 May 2016 15:20:41 +0200 | ||
4 | Subject: [PATCH] Pretend Qt5 wasn't found if OE_QMAKE_PATH_EXTERNAL_HOST_BINS | ||
5 | isn't set | ||
6 | |||
7 | This prevents errors like: | ||
8 | |||
9 | | The imported target "Qt5::Core" references the file | ||
10 | | | ||
11 | | "/qmake" | ||
12 | | | ||
13 | | but this file does not exist. Possible reasons include: | ||
14 | |||
15 | Which happen if CMake is used without setting OE_QMAKE_PATH_EXTERNAL_HOST_BINS. | ||
16 | To achieve this a check for OE_QMAKE_PATH_EXTERNAL_HOST_BINS is added to each Qt5*Config.cmake | ||
17 | file. And in the case where the variable is not set we just return which is basically | ||
18 | equal to telling CMake that Qt5 wasn't found. | ||
19 | |||
20 | Upstream-Status: Pending | ||
21 | The patch only makes sense in connection with other patches included here. | ||
22 | Specifically this are: | ||
23 | - 0003-Add-external-hostbindir-option.patch | ||
24 | - 0010-Add-external-hostbindir-option-for-native-sdk.patch | ||
25 | |||
26 | Signed-off-by: Pascal Bach <pascal.bach@siemens.com> | ||
27 | |||
28 | --- | ||
29 | mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 5 +++++ | ||
30 | src/corelib/Qt5Config.cmake.in | 5 +++++ | ||
31 | 2 files changed, 10 insertions(+) | ||
32 | |||
33 | diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | ||
34 | index d2358ca..feb73c0 100644 | ||
35 | --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | ||
36 | +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | ||
37 | @@ -9,6 +9,11 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0) | ||
38 | endif() | ||
39 | !!ENDIF | ||
40 | |||
41 | +if(NOT DEFINED OE_QMAKE_PATH_EXTERNAL_HOST_BINS) | ||
42 | + message(WARNING "Skipping because OE_QMAKE_PATH_EXTERNAL_HOST_BINS is not defined") | ||
43 | + return() | ||
44 | +endif() | ||
45 | + | ||
46 | !!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND) | ||
47 | !!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) | ||
48 | set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\") | ||
49 | diff --git a/src/corelib/Qt5Config.cmake.in b/src/corelib/Qt5Config.cmake.in | ||
50 | index a872d0e..233d663 100644 | ||
51 | --- a/src/corelib/Qt5Config.cmake.in | ||
52 | +++ b/src/corelib/Qt5Config.cmake.in | ||
53 | @@ -3,6 +3,11 @@ if (CMAKE_VERSION VERSION_LESS 2.8.9) | ||
54 | message(FATAL_ERROR \"Qt5 requires at least CMake version 2.8.9\") | ||
55 | endif() | ||
56 | |||
57 | +if(NOT DEFINED OE_QMAKE_PATH_EXTERNAL_HOST_BINS) | ||
58 | + message(WARNING "Skipping because OE_QMAKE_PATH_EXTERNAL_HOST_BINS is not defined") | ||
59 | + return() | ||
60 | +endif() | ||
61 | + | ||
62 | if (NOT Qt5_FIND_COMPONENTS) | ||
63 | set(Qt5_NOT_FOUND_MESSAGE \"The Qt5 package requires at least one component\") | ||
64 | set(Qt5_FOUND False) | ||
65 | -- | ||
66 | 2.1.4 | ||
67 | |||
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb index ee926f8f..72ef3ae7 100644 --- a/recipes-qt/qt5/qtbase_git.bb +++ b/recipes-qt/qt5/qtbase_git.bb | |||
@@ -21,6 +21,7 @@ SRC_URI += "\ | |||
21 | file://0007-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch \ | 21 | file://0007-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch \ |
22 | file://0008-configure-paths-for-target-qmake-properly.patch \ | 22 | file://0008-configure-paths-for-target-qmake-properly.patch \ |
23 | file://0011-Reorder-EGL-libraries-from-pkgconfig-and-defaults.patch \ | 23 | file://0011-Reorder-EGL-libraries-from-pkgconfig-and-defaults.patch \ |
24 | file://0011-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch \ | ||
24 | " | 25 | " |
25 | 26 | ||
26 | DEPENDS += "qtbase-native" | 27 | DEPENDS += "qtbase-native" |