构建Qt OPC UA Open62541 插件

Open62541 插件默认由包含的第三方源构建,没有外部依赖性。open62541 库使用 OpenSSL 保证安全性。如果在配置过程中检测到 OpenSSL 库,则会启用测试和 open62541 后端的安全性。与Qt OPC UA 捆绑的 Open62541 源文件和头文件是使用以下命令从 open62541 v1.3.11 标签生成的:

cmake -DUA_ENABLE_AMALGAMATION=ON -DUA_AMALGAMATION_ARCHITECTURES="win32;posix" -DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON -DUA_ENABLE_HISTORIZING=ON -DUA_ENABLE_EXPERIMENTAL_HISTORIZING=ON
make

如果要构建 Open62541 插件的自定义版本,则需要使用与上述相同的选项构建 Open62541 v1.3.11。

在使用安装到自定义位置的 open62541 构建时,必须将以下选项传递给 cmake:

-DINPUT_open62541=system -DOPEN62541_INCDIR=/path/to/sdk/include -DOPEN62541_LIBDIR=/path/to/sdk/lib
设置
open62541_incdir包含 open62541.h 的目录
open62541_libdir包含库文件的目录

例如,以下选项可用于在不安装 open62541 插件的情况下,直接从其构建目录使用静态构建方式构建该插件:

-DOPEN62541_INCDIR=/path/to/open62541/build -DOPEN62541_LIBDIR=/path/to/open62541/build/bin

配置步骤的输出会显示检测是否成功:

Open62541 .............................. yes

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.