From 0efd11ae1db3ecc4e9e2193b201f448744a41bed Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 5 Jul 2018 09:14:31 +0200
Subject: [PATCH] [CMake] Find Qt5::X11Extras on Linux with Conan.

---
 Applications/DataExplorer/DataExplorer.cmake | 3 +++
 scripts/cmake/Find.cmake                     | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Applications/DataExplorer/DataExplorer.cmake b/Applications/DataExplorer/DataExplorer.cmake
index 39fee0ee079..3d78aa32ade 100644
--- a/Applications/DataExplorer/DataExplorer.cmake
+++ b/Applications/DataExplorer/DataExplorer.cmake
@@ -69,6 +69,9 @@ target_link_libraries(DataExplorer
 if(NOT APPLE AND OGS_USE_CONAN)
     # HACK for unresolved external
     target_link_libraries(DataExplorer vtkGUISupportQt-8.1)
+    if(UNIX)
+        target_link_libraries(DataExplorer Qt5::X11Extras)
+    endif()
 endif()
 
 # Workaround for Windows conan tiff-package
diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake
index ab867da24e3..6530e929ff7 100644
--- a/scripts/cmake/Find.cmake
+++ b/scripts/cmake/Find.cmake
@@ -97,7 +97,11 @@ find_package(Metis QUIET)
 
 ## Qt5 library ##
 if(OGS_BUILD_GUI)
-    find_package(Qt5 5.2 REQUIRED Gui Widgets Xml XmlPatterns)
+    set(QT_MODULES Gui Widgets Xml XmlPatterns)
+    if(OGS_USE_CONAN AND UNIX AND NOT APPLE)
+        set(QT_MODULES ${QT_MODULES} X11Extras)
+    endif()
+    find_package(Qt5 5.2 REQUIRED ${QT_MODULES})
     cmake_policy(SET CMP0020 NEW)
     set(CMAKE_AUTOMOC TRUE)
     set(CMAKE_AUTOUIC TRUE)
-- 
GitLab