C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
Compiling the SDK and the Examples with NMake

This pages describes how to create NMake makefiles for the SDK and the examples using CMake.

Generate SDK Makefiles

Start a Visual Studio command prompt as administrator and change to the “bin” folder inside the CMake installation directory. Then start the CMake GUI from within the command prompt:

cmake-gui.exe

Click on “Browse Source…” and select the “src” directory below the SDK installation directory (see screenshot).

compilesdkvs2008_selectsrc.png

Select the build folder, i.e. the folder to save generated projects to. Click on “Browse Build…” and pick a folder of your choice. For this example, we’re using a directory named “nmake”.

compilesdknmake_selectbuild.png

Then click on “Configure”. A dialog window will open. Select “NMake Makefiles” from the drop-down list.

compilesdknmake_generator.png

If all the settings are to your liking, press “Generate”. If you’ve changed anything, it’s necessary to click on “Configure” again before generating. When finished, the generated files can be found in the build folder specified above.

compilesdknmake_files.png

Build the SDK with NMake

Now we are ready to build the SDK. Still in the Visual Studio command prompt, change to the folder containing the generated files. Enter

nmake

followed by

nmake install

After a successful build, the result can be found in the folder specified at “CMAKE_INSTALL_PREFIX” above, in our case “C:/Program Files/uasdkc_src”, which is the default for the ANSI C SDK.

compilesdkvs2008_result.png

Generate Makefiles for the Examples

Generating makefiles for the examples delivered with the SDK is quite similar to generating SDK makefiles. We have to pick the source directory and the build directory first.

As source directory, choose the folder “examples” below the SDK installation directory. As build directory, pick a folder of your choice. We’ve created a subdirectory “nmake_examples” of the SDK installation directory.

compilesdknmake_examplepath.png

Then click on “Configure” and pick your compiler from the drop-down list (see above).

Before generating the projects, we have to change “CMAKE_INSTALL_PREFIX”. Pick the same directory as set for the SDK, in this case “C:/Program Files/uasdkc_src” (see above).

compilesdkvs2008_installprefix.png

Click on “Configure” again, then on “Generate”. When finished, the project files can be found in the build folder.

compilesdknmake_examplefiles.png

Now open you can build the examples in the same way as described above for the SDK. Change to the build folder (in our case the directory “nmake_examples” below the SDK installation folder) and enter

nmake
nmake install

When finished, the binaries can be found in the subfolder “bin” of the folder specified at “CMAKE_INSTALL_PREFIX”.

compilesdkvs2008_examplesresult.png