From 09a5b9c25011b6976813130239994661ab1b0d66 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 19 Feb 2026 23:07:58 +0100 Subject: 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. --- cmake/BuildDeps.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) 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() -- cgit v1.2.3