Creating Visual Studio Project files for the SDK using CMake

Short descriptions on how to use the SDK, the build environment and giving hints on some tricky issues.
Post Reply
User avatar
Support Team
Hero Member
Hero Member
Posts: 2521
Joined: 18 Mar 2011, 15:09

Creating Visual Studio Project files for the SDK using CMake

Post by Support Team »

This HowTo will show you how to compile the SDK with CMake, but will not explain CMake in depth. For the interested reader we recommend to read the CMake Tutorial and the CMake Documentation to get a full understanding of CMake.

Important: This HowTo shows the possibility of building the source SDK (this will also work for all examples even in EVAL packages).

There are two different ways to create Visual Studio Project files with CMake:

Using the QT CMake-GUI:
  • Download and install CMake (CMake > 2.8.0 CMake).
  • Start the cmake-gui and add the path to Unified Automation SDKs source folder into the first text box (e.g.: D:/work/sdk/src).
  • Add the new Visual Studio projects folder into the second text box (e.g.: D:/work/sdk/bld).
  • Press the button Configure, choose your Visual Studio version (2008, 2012 - 32Bit or 64Bit) and press Finish.
  • IMPORTANT: If you want to create Visual Studio projects for 64Bit support, you have to select win64 in the THIRD_PARTY_PATH Option.
  • Press Configure again and, if no error occures, press Generate.
  • Open the folder with the generated Visual Studio projects, start the solution and compile the SDK.

Using the Visual Studio Command Prompt:
  • Start your Visual Studio Command Prompt, navigate into the installed folder of the SDK and create a temporary folder (e.g. bld) to store the created Visual Studio Project files.
  • Step into this folder and create the Visual Studio Project files with cmake -G "Visual Studio " -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Debug ../src (or use cmake -G "Visual Studio " -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release../src for Release builds).
  • Locate the folder and start up the generated Solution file to compile and install the SDK.
  • If the path of CMAKE_INSTALL_PREFIX is different to the path of the SDK you have to copy the ServerConfig.xml file ( located in sdk/bin ) into the newly created bin folder to start up the Demo Server.
Best regards
Unified Automation Support Team

Post Reply