— IslandCT Blog —

Island Creative Time

IsCT home
full blog list

23 — Kicad relative paths.

2015-06-07. By Patrick.

Fig. 1.    Main Kicad screen running in Debian 7 xfce.

Lately, I have been using Kicad to design our next set of 80m ARDF transmitters. I'm going to describe here the way I handle relative paths in Kicad because I had problems working with Kicad on multiple computers. I'm still not sure the current system is the way I'll keep doing it but it works well enough for now. And, although I'm going to describe a number of problems I had, I really like Kicad and some of the problems may actually be my own misunderstanding of how Kicad should be used.

The main problem I encountered with Kicad occurred while trying to work on a project on several computers. My instinct in working on project is to make sure they are contained in a single directory. Like that, I can transfer the entire directory from one computer to the next and start working immediately. The problem with Kicad first occurred when I created a new component and saved it to a custom library. I used the option to use relative paths because that would allow me to keep the project and the library in the same folder or even keep the library inside the project's folder. But after moving the folder, Kicad was unable to find the library. The reason was that the relative path was not the way I think of relative paths.

Let's go over a made up example. Let's say we have project-a in folder '/home/pat/kicad-projects/project-a/', and a library mylib in a folder '/home/pat/kycad-projects/mylib/'. I would think a simple relative path from project-a to mylib would be '../mylib'. But the path Kicad creates is '../../../home/pat/kicad-projects/project-a/mylib'. The way I would do it, I could move project-a and mylib anywhere as long as I kept them together. The way Kicad does it, moving the projects to a different location in the file system or moving them to a computer where the file system is a bit different fails. Let's say I want to move them to '/home/pat/electronics/kicad-projects'. Fail.

But a bit of searching gave me a simple solution. Only one line in one file needs to be changed. In our example it would be the file project-a.pro. Searching the file for 'mylib' will find the line to be changed. When I replace the path Kicad had created with my relative path, all works fine when I move the project around. Of course I have to keep the relative location of the library the same.

Creating foot print libraries works the same way. I search the project file for the name of the libray and change it to a simpler relative path. I created a script to do all this automatically but I haven't tested it enough to use it routinely on real projects.

Another problem occurs while moving from a computer with one version of Kicad to another with a different version. I'm not sure exactly what is saved with the project but I have come across instance where a module (Kicad's term for footprint) was missing when I move the project to a system with an older version of Kicad. But I'm pretty sure there is a way to save all the modules in the current project to the local project's folder. I just haven't tried it yet. But it does mean that sending a project to another person has to be carefully.

When first learning how to use Kicad, I would save my custom component library in the project in which I was working at the time. This guaranteed that moving the project would always include the components used and that these would not be changed by mistake while working on another project. But now that I'm more familiar with Kicad, I'm much faster at starting it up and putting together a quick schematic. This also means that I want a single library for all my projects so that I don't have to re-create custom components that I use often. This also means I have to be much more careful about version control because making a change to a component while working on one project could break another project. In the end, the need for caution is worth the easy availability of custom components.

So if you decide to try Kicad, relative paths are easy to handle once you know the work-arounds. And remember that a project may need access to the libraries that it used.

The text we wrote, pictures we took, and system we used to layout our web pages are licensed under the Creative Commons Attribution 4.0 International License. Link to License. This means that you can copy anything you want, use it and alter it as you want, as long as you give credit to us for the original work, provide a link to the license, and explain any changes you made. We try to make sure all other content we display is also available to use. But check the sources we list before using them.