This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to move an SDK example out of the SDK tree?

This question is a follow on to https://devzone.nordicsemi.com/f/nordic-q-a/38085/how-to-create-a-copy-of-examples-project---segger-embedded-studio.

It's clear that making a copy of an example by copying the example folder will work, but ONLY if the location for your project is in the same position relative in the SDK directory tree as the Examples folder.  The reason for this is that all the c_user_include_directories in the .emProject file are relative references to the location of the emProject file.

What I would like to do is copy the example files into my own directory, totally separate from the SDK, and change the references to SDK files from:

../../../../../../components/boards

to something like

$(SDK)/components/boards

Where $(SDK) references C:\nRF\nRF5_SDK_15.2.0_9412b96 (in my case)

Editing the .emProject file would be trivial by simply doing a global text change of '../../../../../..' to '$(SDK)'.

What syntax would I use in the emProject file (for $(SDK))?   And where would I define SDK?

Related