Compiling the SDK for Linux with 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: 3064
Joined: 18 Mar 2011, 15:09

Compiling the SDK for Linux with 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 compile the SDK with CMake:

Using the CMake-GUI ccmake:
  • First of all navigate into the extracted folder of the SDK and create a temporary folder (e.g. bld) to store the created Makefiles.
  • After that, step into this folder and start the CMake-GUI with ccmake ../src
    and set all desired settings (the settings of the master CMakeLists.txt file are default to each individual SDK).
  • Please set the CMAKE_INSTALL_PREFIX (-> where to install the header files, libraries and application) to a valid path and set the CMAKE_BUILD_TYPE to your desired build type (e.g. Debug).
  • If everything is to your contentment, configure the Makefiles by pressing the button c.
  • Finish the configuration by pressing the button g. This will generate the Makefiles and close the CMake-GUI.
  • Compile and install the SDK with make all install
  • 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.
Using the shell:
  • Navigate into the extracted folder of the SDK and create a temporary folder (e.g. bld) to store the created Makefiles.
  • Step into this folder and create the Makefiles with
    Debug:

    Code: Select all

    cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Debug ../src
    Release:

    Code: Select all

    cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release ../src
  • Compile and install the SDK with make all install
  • 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