The mesh library and example applications can be built using either CMake or SEGGER Embedded Studio.
Using CMake provides the possibility to build both for host (unit tests) and target, while SEGGER Embedded Studio provides a way of quickly getting the example code up and running with full debug capability.
Before you continue, check Installing the toolchain for instructions on setting up the development environment for mesh.
The nRF5 SDK for Mesh now requires the nRF5 SDK to compile. By default, the nRF5 SDK is expected to be adjacent to the nRF5 SDK for Mesh. The directory structure should look like this:
. +-- nrf5_sdk_for_mesh/ +-- nRF5_SDK_15.0.0_a53641a/
You can get the correct SDK in two ways: manually or by using a custom CMake target.
Download the nRF5 SDK version 15.0.0 from the web: developer.nordicsemi.com. Extract it in the same folder as the nRF5 SDK for Mesh to match the folder structure above.
Generate CMake build files as in Building with CMake , e.g.:
nrf5_sdk_for_mesh $ mkdir build nrf5_sdk_for_mesh $ cd build build $ cmake -GNinja ..
You will get a warning that the nRF5 SDK isn't found. Run the nRF5_SDK
target:
build $ ninja nRF5_SDK
This will download and extract the correct nRF5 SDK in the folder adjecent to the nRF5 SDK for mesh. After the download is complete, re-run CMake and it will pick up the correct paths:
build $ cmake ..
Please follow the guide for your preferred toolchain. See Building with CMake or Building with SEGGER Embedded Studio.