From bc206d50cf8c0d0fc9f90cce58a2499ec945bd29 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Wed, 9 Jan 2019 20:41:28 +0100
Subject: [PATCH] Avoid overwriting Qt5_FOUND with Qt5DBus or Qt5WebEngine
 disabled

---
 CMakeLists.txt | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9261a67a4..82f7206d2 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -121,18 +121,13 @@ find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED
 )
 
 if(CMAKE_SYSTEM_NAME STREQUAL Android)
-    find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED
-        COMPONENTS
-            Positioning
-            Multimedia
-    )
+    find_package(Qt5Positioning ${REQUIRED_QT_VERSION} REQUIRED)
+    find_package(Qt5Multimedia)
+
    set ( MARBLE_NO_WEBKITWIDGETS TRUE )
 else()
-   find_package(Qt5 ${REQUIRED_QT_VERSION}
-        COMPONENTS
-            WebEngine
-            WebEngineWidgets
-    )
+    find_package(Qt5WebEngine ${REQUIRED_QT_VERSION})
+    find_package(Qt5WebEngineWidgets ${REQUIRED_QT_VERSION})
 
    if ( NOT Qt5WebEngineWidgets_FOUND )
      set ( MARBLE_NO_WEBKITWIDGETS TRUE )
@@ -140,7 +135,7 @@ else()
 endif()
 
 if (BUILD_WITH_DBUS)
-  find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS DBus)
+  find_package(Qt5DBus ${REQUIRED_QT_VERSION} COMPONENTS)
   if (NOT Qt5DBus_FOUND)
     set(MARBLE_NO_DBUS TRUE)
   endif()
-- 
2.20.1
