From 4398d571b0a316b24677f0513fc9d5d82eb28ab2 Mon Sep 17 00:00:00 2001
From: "Dmitry Yu. Naumov" <github@naumov.de>
Date: Thu, 13 Sep 2018 16:06:44 +0200
Subject: [PATCH] [App/IO] Link to QtBase if gui is being build.

The XmlPrjInterface needs the OGSError::box, which is
part of the QtBase.
---
 Applications/FileIO/CMakeLists.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Applications/FileIO/CMakeLists.txt b/Applications/FileIO/CMakeLists.txt
index 9f624790b0d..c83d1009486 100644
--- a/Applications/FileIO/CMakeLists.txt
+++ b/Applications/FileIO/CMakeLists.txt
@@ -28,6 +28,11 @@ target_link_libraries(ApplicationsFileIO
     PRIVATE MeshLib
 )
 
+if(OGS_BUILD_GUI)
+    # Needed for the XmlPrjInterface, which links the DE/Base/OGSError.h.
+    target_link_libraries(ApplicationsFileIO PUBLIC QtBase)
+endif()
+
 if(Shapelib_FOUND)
     target_link_libraries(ApplicationsFileIO PRIVATE ${Shapelib_LIBRARIES})
 endif()
-- 
GitLab