C++ Based OPC UA Client/Server SDK  1.5.3.346
Configuring the SDK with CMake

Overview

When building the SDK using CMake, it can be configured in a number of ways using the CMake options described below.

SDK Configuration

The following options influence whether the SDK and/or the UaStack are built as shared libraries or statically.

BUILD_SHARED_STACK
Build the UaStack as a shared library.
BUILD_SHARED_LIBS
Build the SDK and all of its modules as shared libraries.
BUILD_UABASECPP
Build the UaBaseCpp library (needed for all C++ products).
BUILD_UAPKICPP
Build the UaPkiCpp library; contains classes to create and work with X.509 certificates.
BUILD_WITH_COM_UTILITIES
Adds COM data type conversion utilities, e.g. in UaVariant
UASDK_WITH_XMLPARSER

Server SDK Configuration

The following options affect the Server SDK library:

BUILD_UAMODELS
Build the UaModels library (contains PLCopen and DI namespace).
BUILD_UAMODULE
Build the UaModule library (needed for Server development).
UASDK_WITH_AUDITING_SERVER_FACET
Build the SDK with support for audit events (Auditing Server Facet).
UASDK_WITH_EVENT_SUBSCRIPTION_SERVER_FACET
Build the SDK with support for events (Event Subscription Server Facet).
UASDK_WITH_HISTORICAL_ACCESS
Build the SDK with support for Historical Access.
UASDK_WITH_METHOD_SERVER_FACET
Build the SDK with support for method calls (Method Server Facet)
UASDK_WITH_NODE_MANAGEMENT_SERVER_FACET
Build the SDK with the Node Management Server Facet (add and delete nodes and references via service calls).
UASDK_WITH_TRACE_CONFIGURATION
Support of trace configuration through VendorServerInfo in Server Object.
UASDK_WITH_TRACE_EVENTS
Support of trace output as OPC UA events.

Client SDK Configuration

The following options affect the Client SDK library:

BUILD_UACLIENTC
Enable building the Client SDK.

UaStack

The UaStack can also be configured in a number of ways, especially the options regarding timers have to be set carefully.

UASTACK_USE_SYNCHRONIZATION
Build the UaStack with synchronization support. This option always has to be ON because the SDK works multithreaded.
UASTACK_CLIENTAPI_ENABLED
Enable the client API of the UaStack. This option has to be ON when building the Client SDK.
UASTACK_SERVERAPI_ENABLED
Enable the server API of the UaStack. This option has to be ON when building the Server SDK.

The following options configure the security and encryption abilities of the UaStack.

UASTACK_SUPPORT_SECURITYPOLICY_NONE
Enable support for the None security policy.
UASTACK_SUPPORT_SECURITYPOLICY_BASIC128RSA15
Enable support for the Basic128Rsa15 security policy. Only available if UASTACK_WITH_OPENSSL is set to ON.
UASTACK_SUPPORT_SECURITYPOLICY_BASIC256
Enable support for the Basic256 security policy. Only available if UASTACK_WITH_OPENSSL is set to ON.
UASTACK_SUPPORT_SECURITYPOLICY_BASIC256SHA256
Enable support for the Basic256Sha256 security policy. Only available if UASTACK_WITH_OPENSSL is set to ON.
UASTACK_WITH_OPENSSL
Enable support for encryption and signing.
UASTACK_WITH_PKI_WIN32
Enable support for using the Windows certificate store.

The next set of options enable or disable features in the UaStack, aiming to influence the resulting code and binary size of the UaStack.

UASTACK_MINIMAL_DISABLE_TRACE
Disable the trace functionality.
UASTACK_MINIMAL_OMIT_TYPE_NAME
Omit the type name string of encodeable types.
UASTACK_MINIMAL_SMALL_DATAVALUE
Reduce the size of OpcUa_DataValue by removing the picoseconds in timestamps.

There are three advanced CMake options influencing the number of connections that can be created to/from the SDK. You can show them by checking the “Advanced” check box in the CMake GUI.

The following values are the minimum required amounts of resources for the targeted functionality, so a reserve should be included when setting the values.

UASTACK_TCPLISTENER_MAX_CONNECTIONS
The maximum number of client connections per endpoint
UASTACK_SOCKETMANAGER_NUMBER_OF_SOCKETS
Server: UASTACK_TCPLISTENER_MAX_CONNECTIONS plus 3
Client: 2
An application that includes both client and server functionality, the number required for the server part is decisive, as this number is always larger than 2. More information about UASTACK_SOCKETMANAGER_NUMBER_OF_SOCKETS can be found below.
UASTACK_NUMBER_OF_AVAILABLE_TIMERS
Server: One per configured endpoint
Client: Two times the desired number of connections (each connection requires two timers). Note that for applications containing client and server functionality you need to add the numbers of timers for the client and server side.

The following options are only visible after setting the CMake option ENABLE_EXPERIMENTAL_OPTIONS to ON. We do not recommend to change any of these options.

ENABLE_STATIC_CRT
Build against the static C runtime.
UASTACK_GUID_STRING_USE_CURLYBRACE
Set to ON to force OpcUa_Guid_ToString() to create curly braces around GUIDs. This is no longer the default behavior.
UASTACK_MINIMAL_SMALL_VARIANT
Set to ON to reduce the size of OpcUa_Variant by disabling matrix values and reducing the string size.
UASTACK_STATIC_PLATFORM
Set to ON to build the UaStack library with a static platform layer; do not change this setting because your product will not work if set to OFF.
UASTACK_WITH_HTTPS
Enable experimental support for HTTPS.
UASTACK_WITH_TLS
Set this to ON if you enabled UASTACK_WITH_HTTPS.

Notes on UASTACK_SOCKETMANAGER_NUMBER_OF_SOCKETS

The UaStack parameter UASTACK_SOCKETMANAGER_NUMBER_OF_SOCKETS has to be calculated differently for single-threaded and multithreaded mode. The C++ SDK works only multithreaded, so this variant will be described below.

For each endpoint a server provides, a separate socketmanager is created. Thus, to calculate UASTACK_SOCKETMANAGER_NUMBER_OF_SOCKETS the number of connections per endpoint is important. We need one socket per connection, plus one internal socket, one listen socket, and one reserved socket: For instance, for a server providing two endpoints, each accepting five connections, UASTACK_SOCKETMANAGER_NUMBER_OF_SOCKETS is 8: The number of connections per endpoint (5) plus 3. The number of endpoints is not relevant.

For clients, a separate socketmanager is created for each connection, each containing an internal socket and a connection socket. Thus, UASTACK_SOCKETMANAGER_NUMBER_OF_SOCKETS is always 2, regardless of the number of connections per client.

If an application has both client and server functionality, only UASTACK_SOCKETMANAGER_NUMBER_OF_SOCKETS for the server part is relevant, because the smallest possible number for a server is 4 (one connection per endpoint plus 3), which is obviously greater than 2.