ANSI C Based OPC UA Client/Server SDK  1.9.0.430
Generating Project Files for Visual Studio

This pages describes how to create project files for Visual Studio 2008 and higher for the SDK and the examples using CMake.

Generate SDK Projects

Start the CMake GUI as administrator. 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 “vs2015”, because we’re generating projects for Visual Studio 2015.

compilesdkvs2008_selectbuild.png

Then click on “Configure”. A dialog window will open. Choose your compiler from the drop-down list (see screenshot). We’re picking “Visual Studio 14 2015 Win64”.

compilesdkvs2008_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 project files can be found in the build folder specified above.

compilesdkvs2008_files.png

Build the SDK with Visual Studio

To build the SDK, open the solution file generated above in Visual Studio. In our case, it’s called uasdkc_src.sln, because we were using the ANSI C SDK for this example. The name differs depending on the product.

“ALL_BUILD” is already set as start-up project, so you can simply build the solution. When finished, build “INSTALL”.

compilesdkvs2008_install.png

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 Example Projects

Generating projects for the examples delivered with the SDK is quite similar to generating SDK projects. 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 “vs2015examples” of the SDK installation directory.

compilesdkvs2008_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.

compilesdkvs2008_examplefiles.png

Now open the sln file in Visual Studio. Build the solution, then build “INSTALL”. When finished, the binaries can be found in the subfolder “bin” of the folder specified at “CMAKE_INSTALL_PREFIX”.

compilesdkvs2008_examplesresult.png