# Building and debugging emb-template

Apr 17, 2015

Once you checked out https://github.com/DataArt/ebc-template repository and created a separate directory for out-of-source build, you need to run a command like this:

cmake ../mbed-template/ -DCMAKE_TOOLCHAIN_FILE=../mbed-template/lm3s6965evb.cmake \
-DTOOLCHAIN_PATH=~/gcc-arm-none-eabi/bin -DQEMU_PATH=~/qemu-arm/bin

The first argument of the cmake command specifies a directory that contains CMakeLists.txt file - a file that holds project description, and defines rules of how to compile and link the project.

DCMAKE_TOOLCHAIN_FILE argument specifies so called toolchain file. This file basically redefines standard cmake definitions. It can define the way cmake actually invoke particular command. For instance, if you need to use arm-none-eabi-gcc executable insteard of gcc, this file is a right place to acomplish this.