Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Fail silently if system Qt installation is broken |
| 2 | |
| 3 | Fixes a regression in behaviour from 2.8.10 to 2.8.11 resulting in the |
| 4 | following error if the system Qt installation is broken: |
| 5 | |
| 6 | CMake Error at Modules/FindQt4.cmake:1028 (set_property): |
| 7 | set_property could not find TARGET Qt4::QtCore. Perhaps it has not yet |
| 8 | been created. |
| 9 | Call Stack (most recent call first): |
| 10 | Tests/RunCMake/CMakeLists.txt:79 (find_package) |
| 11 | |
| 12 | Upstream-Status: Pending |
| 13 | |
| 14 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> |
| 15 | |
| 16 | The patch was slightly adapted in order to match cmake 3.2.2: |
| 17 | Another set_property was introduced which had to be included |
| 18 | within the if(QT_QTCORE_FOUND) statement. |
| 19 | |
| 20 | Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de> |
| 21 | --- |
| 22 | Modules/FindQt4.cmake | 39 ++++++++++++++++++++------------------- |
| 23 | 1 file changed, 20 insertions(+), 19 deletions(-) |
| 24 | |
| 25 | diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake |
| 26 | index 6704769..9048e35 100644 |
| 27 | --- a/Modules/FindQt4.cmake |
| 28 | +++ b/Modules/FindQt4.cmake |
| 29 | @@ -1000,25 +1000,26 @@ if (QT_QMAKE_EXECUTABLE AND |
| 30 | endif() |
| 31 | endmacro() |
| 32 | |
| 33 | - |
| 34 | - # Set QT_xyz_LIBRARY variable and add |
| 35 | - # library include path to QT_INCLUDES |
| 36 | - _QT4_ADJUST_LIB_VARS(QtCore) |
| 37 | - set_property(TARGET Qt4::QtCore APPEND PROPERTY |
| 38 | - INTERFACE_INCLUDE_DIRECTORIES |
| 39 | - "${QT_MKSPECS_DIR}/default" |
| 40 | - ${QT_INCLUDE_DIR} |
| 41 | - ) |
| 42 | - set_property(TARGET Qt4::QtCore APPEND PROPERTY |
| 43 | - INTERFACE_COMPILE_DEFINITIONS |
| 44 | - $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG> |
| 45 | - ) |
| 46 | - set_property(TARGET Qt4::QtCore PROPERTY |
| 47 | - INTERFACE_QT_MAJOR_VERSION 4 |
| 48 | - ) |
| 49 | - set_property(TARGET Qt4::QtCore APPEND PROPERTY |
| 50 | - COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION |
| 51 | - ) |
| 52 | + if(QT_QTCORE_FOUND) |
| 53 | + # Set QT_xyz_LIBRARY variable and add |
| 54 | + # library include path to QT_INCLUDES |
| 55 | + _QT4_ADJUST_LIB_VARS(QtCore) |
| 56 | + set_property(TARGET Qt4::QtCore APPEND PROPERTY |
| 57 | + INTERFACE_INCLUDE_DIRECTORIES |
| 58 | + "${QT_MKSPECS_DIR}/default" |
| 59 | + ${QT_INCLUDE_DIR} |
| 60 | + ) |
| 61 | + set_property(TARGET Qt4::QtCore APPEND PROPERTY |
| 62 | + INTERFACE_COMPILE_DEFINITIONS |
| 63 | + $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG> |
| 64 | + ) |
| 65 | + set_property(TARGET Qt4::QtCore PROPERTY |
| 66 | + INTERFACE_QT_MAJOR_VERSION 4 |
| 67 | + ) |
| 68 | + set_property(TARGET Qt4::QtCore APPEND PROPERTY |
| 69 | + COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION |
| 70 | + ) |
| 71 | + endif() |
| 72 | |
| 73 | foreach(QT_MODULE ${QT_MODULES}) |
| 74 | _QT4_ADJUST_LIB_VARS(${QT_MODULE}) |
| 75 | -- |
| 76 | 1.9.1 |
| 77 | |