From 2feee0368fb29becd7c879960b9761472c2d8060 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Tue, 16 May 2023 15:59:00 +0200
Subject: [PATCH] Set correct rpath for the plugin

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 737cfff..dc58a05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,6 +64,12 @@ cmake_path(APPEND module_dir "${qtqmldir}" "${module_target_path}")
 
 message(STATUS "Module dir ${module_dir}")
 
+# allow the installed plugin to find its backing library
+set_property(
+    TARGET "${module_plugin_target}"
+    APPEND PROPERTY INSTALL_RPATH "${qtlibdir}"
+)
+
 # Install the QML module runtime loadable plugin
 install(TARGETS "${module_plugin_target}"
     LIBRARY DESTINATION "${module_dir}"
-- 
GitLab