C++ Based OPC UA Client/Server/PubSub SDK
1.7.4.520
|
To compile the SDK from source, at least GCC version 4.7.2 is required.
In addition, it is assumed that all required third-party libraries are correctly installed.
The source version of the SDK for Linux is shipped with two bash scripts to build the SDK and the examples in debug and release mode with default settings.
Unpack the SDK:
Change to the extracted folder named “sdk”. Execute the script buildSdk.sh to build the SDK:
To build all examples delivered with the SDK execute the script buildExamples.sh:
Install CMake with your Linux distribution’s package manager or download and build the source distribution of CMake from https://cmake.org/download/.
Unpack the SDK:
Change to the extracted folder “sdk”, create a subfolder named “bld” and start ccmake from within, using the file CMakeLists.txt in sdk/src/:
Press “c” to configure and change the settings to your liking, e.g. set the build type and change the install prefix (see screenshot). We’re using a new folder “dist” inside “sdk” for this example.
When finished, press “c” to configure again, followed by “g” to generate the makefile and exit ccmake. Now we are ready to compile the SDK:
When finished, install the SDK to the folder specified at “CMAKE_INSTALL_PREFIX”:
Creating makefiles for the examples is quite similar as described above for the SDK. Create a new folder below “sdk”, e.g. named “bldexamples”, and start ccmake from within, this time using the CMake file inside sdk/examples:
Press “c” to configure, set C_MAKE_BUILD_TYPE, set “CMAKE_INSTALL_PREFIX” to the same folder as set above for the SDK.
When finished, press “c” to configure again, followed by “g” to generate the makefile for the examples and exit ccmake.
Now we can build and install the examples:
When finished, the binaries can be found in the subfolder bin of the folder specified at “CMAKE_INSTALL_PREFIX” (see screenshot).