ThingWorx Edge C SDK > Building a ThingWorx Edge C SDK Application > Building Applications with CMake > How to Build for Linux Platforms with CMake
  
How to Build for Linux Platforms with CMake
The following procedure assumes that you have downloaded and extracted CMake and that you have created a subdirectory where the output of cmake will be stored within the directory that contains your source files. To build for a Linux platform using CMake, follow these steps:
1. Navigate to the subdirectory that you created for running cmake.
2. If the parent directory contains your source code (as recommended), run cmake ... If you want to use a toolchain other than the default, include the -G argument and specify the toolchain.
3. Run make.
CMake builds your application.
For example, to build the C SDK using CMake
cd tw-c-sdk
mkdir buildoutput
cd buildoutput
cmake ..
make
Specifying a Custom Installation Directory for the C SDK
By default the C SDK headers and libraries install under /usr/local/ when the make install command is run. To override this default location, use the CMake variable, CMAKE_INSTALL_PREFIX when running CMake. For example:
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/thingworx/
Afterwards, running make install would install the C SDK to /opt/thingworx/.