Creating Eclipse 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: 3064
Joined: 18 Mar 2011, 15:09

Creating Eclipse 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).

It is possible to create Eclipse Project files for Windows as well as for Linux. This can be done in two different ways:

Using the CMake-GUI:
  • To create Eclipse Project files for the SDK, start up the cmake-gui.exe for Windows or the CMake-GUI ccmake for Linux. In the CMake-GUI locate the src folder of the SDK and set a folder where to create the Eclipse Project files.
  • Press Configure and set Eclipse CDT4 - Unix Makefiles as generator for this project. This will create the folder you have chosen before and will show you all available options of the SDKs master CMakeLists.txt.
  • Set all options as desired and do not forget to set also the install prefix.
  • Press Configure again to adopt the options.
  • Press Generate to generate the Eclipse Project files.
Using the Windows Command Prompt/Linux Shell:
  • Start your Windows Command Prompt or your Linux Shell, navigate into the installed/extracted folder of the SDK and create a temporary folder (e.g. bld) to store the created Eclipse Project files.
  • Step into this folder and create the Eclipse Project files with
    Debug:

    Code: Select all

    cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Debug ../src
    Release:

    Code: Select all

    cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release ../src
Regardless of which way you have decided to create the Eclipse Project files, open up your Eclipse IDE and import the generated Eclipse Project files via File->Import->General/Existing Projects into Workspace->Select root directory. After that right click on the imported project and select Build to compile the SDK.
Best regards
Unified Automation Support Team

Post Reply