summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-19 23:07:58 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-19 23:07:58 +0100
commit09a5b9c25011b6976813130239994661ab1b0d66 (patch)
treeb0dcb6393c9ace3e63255b60e534ae1044d30b51
parentf4da422087f77ce9a549ff73250910e5ae217ff0 (diff)
downloadBobinkQtOpcUa-09a5b9c25011b6976813130239994661ab1b0d66.tar.gz
BobinkQtOpcUa-09a5b9c25011b6976813130239994661ab1b0d66.zip
Fix open62541 backend plugin failing to load at runtime
The QtOpcUa backend plugin has $ORIGIN-relative RUNPATH resolving to qtopcua-install/lib/, but libopen62541.so lives in a separate install prefix. Symlink the open62541 libs into the QtOpcUa lib dir so dlopen can find them.
-rw-r--r--cmake/BuildDeps.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/BuildDeps.cmake b/cmake/BuildDeps.cmake
index 1b8eae3..890da57 100644
--- a/cmake/BuildDeps.cmake
+++ b/cmake/BuildDeps.cmake
@@ -119,3 +119,13 @@ if(NOT EXISTS "${QTOPCUA_INSTALL_DIR}/lib/libQt6OpcUa.so")
else()
message(STATUS "qtopcua already built, skipping")
endif()
+
+# The QtOpcUa backend plugin uses $ORIGIN-relative RUNPATH that resolves to
+# qtopcua-install/lib/. Symlink the open62541 libs there so dlopen finds them.
+file(GLOB _open62541_libs "${OPEN62541_INSTALL_DIR}/lib/libopen62541*")
+foreach(_lib ${_open62541_libs})
+ get_filename_component(_name ${_lib} NAME)
+ if(NOT EXISTS "${QTOPCUA_INSTALL_DIR}/lib/${_name}")
+ file(CREATE_LINK ${_lib} "${QTOPCUA_INSTALL_DIR}/lib/${_name}" SYMBOLIC)
+ endif()
+endforeach()