Actually I have two qustions, but they are related with the same challenge.
So, I want to develop application using SDK (libararies and config), but starting from empty project. To create empty buildable project for nRF52DK I need to include a lot of necessery files, such as sdk_config.h, boards.c ... etc. So, can you give list of all files, which I need to include in project, to be able to correctly build it, and also which configuration I need to do? For example what I need to do to create project the same as examples/peripheral/template_project?
I also want to know, how to change folder of existing project? For example if I change directory of template_project from examples, how can I repair links to necessery files?
One technique that works for me is described here:
It's a little bit cheating, but here's the summary. (Below, I'm using $SDK as a shorthand for the directory containing the SDK of your choice):
1. Create a "myprojects/" directory under the example directory of your SDK:
$ mkdir $SDK/examples/myprojects
2. Copy an example project of your choice into the myprojects directory, renaming it if you wish:
$ cp -rp $SDK/examples/peripheral/timer $SDK/examples/myprojects/test_a
3. Open the .emProject inside that directory, e.g.:
$ open $SDK/examples/myprojects/test_a/pca10040/blank/ses/timer_pca10040.emProject
Now you can modify, compile and run the app according to your needs.
I only call this "cheating" because you're still building inside the SDK directory rather than a sandboxed directory of your choosing, but it works. The biggest advantage of this approach is that you don't need to update all the links to the include files and libraries and whatnot (which is really tedious). A few points:
The above approach works for me. Its quick and easy. Your mileage may vary.
This is the way I do it too. Alternatively you can init git on the whole SDK and add the files and folders that you do not use to gitignore.