From 9693c7bd8a416c1ececb89bf47fd1db4d77eaa79 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 15 Feb 2018 10:02:24 +0100
Subject: [PATCH] [CMake] Added packaging of Qt mac plugin.

---
 scripts/cmake/packaging/PackagingMac.cmake | 8 ++++++++
 scripts/cmake/packaging/PackagingWin.cmake | 3 +--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/cmake/packaging/PackagingMac.cmake b/scripts/cmake/packaging/PackagingMac.cmake
index e34bfff76b6..a5109cb8021 100644
--- a/scripts/cmake/packaging/PackagingMac.cmake
+++ b/scripts/cmake/packaging/PackagingMac.cmake
@@ -16,3 +16,11 @@ set(CPACK_DMG_DS_STORE ${PROJECT_SOURCE_DIR}/scripts/packaging/.DS_Store)
 if(OGS_USE_CONAN)
     SET(CMAKE_INSTALL_RPATH "@executable_path")
 endif()
+
+if(OGS_BUILD_GUI)
+    install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS)
+    file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
+        "[Paths]\nPlugins = ../${_qt_plugin_dir}\n")
+    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
+        DESTINATION bin COMPONENT ogs_gui)
+endif()
diff --git a/scripts/cmake/packaging/PackagingWin.cmake b/scripts/cmake/packaging/PackagingWin.cmake
index 4e87b42c8d4..8f9db72c7d8 100644
--- a/scripts/cmake/packaging/PackagingWin.cmake
+++ b/scripts/cmake/packaging/PackagingWin.cmake
@@ -27,6 +27,5 @@ if(OGS_BUILD_GUI)
     file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
         "[Paths]\nPlugins = ../${_qt_plugin_dir}\n")
     install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
-        DESTINATION bin
-        ${COMPONENT})
+        DESTINATION bin COMPONENT ogs_gui)
 endif()
-- 
GitLab