diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-19 23:07:58 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-19 23:07:58 +0100 |
| commit | 09a5b9c25011b6976813130239994661ab1b0d66 (patch) | |
| tree | b0dcb6393c9ace3e63255b60e534ae1044d30b51 /cmake/BuildDeps.cmake | |
| parent | f4da422087f77ce9a549ff73250910e5ae217ff0 (diff) | |
| download | BobinkQtOpcUa-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.
Diffstat (limited to 'cmake/BuildDeps.cmake')
| -rw-r--r-- | cmake/BuildDeps.cmake | 10 |
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() |
