Library setup and environment variables questions

A few questions on libraries.

  • Can library variables contain multiple directories? If so, what is the separation character?

  • Are there any directories searched besides those in the environment variable and/or the Path Configuration dialog?

Here’s where setup the libraries are apparently obtained from:

Environment Variable    Contains    Directory (Default?)
$KISYS3DMOD             3d models   $INSTALL\share\kicad\modules\packages3d\
$KISYSMOD               footprint   $INSTALL\share\kicad\modules\
$KICAD_PTEMPLATES       Templates   $INSTALL\share\kicad\template\
NONE?                   symbols     $INSTALL\share\kicad\library

On my windows system (KiCad version 4.0.7), the KICAD_SYMBOL_DIR as shown in the Configure Paths dialog does not have a corresponding environment variable. It’s value in Configure Paths is C:\msys64\mingw64\share\kicad\library\ which doesn’t exist on my system. The KISYS3DMOD and KISYSMOP do have corresponding environment variables.

Any idea why

  1. the KICAD_SYMBOL_DIR seems wrong in the dialog yet symbols are still found, and
  • KICAD_SYMBOL_DIR is not an environment variable?

I wondered about the KICAD_SYMBOL_DIR some time ago, too.

Since I was preparing a 70 seat classroom install, I took my question to the developer mailing list before doing something stupid on 70 computers at the same time:

We are using a centrally managed library for schematic symbols and pcb footprints which is stored on a network share.

To make that work, the paths in the ‘kicad.pro’ template file and the environment variables KICAD_PTEMPLATES KISYSMOD and KISYS3DMOD are modified to point to the correct network share folders.

My test install shows that for schematic symbols a new file ‘sym_lib_table’ has been introduced, analog to ‘fp_lib_table’ for footprints. In that file a variable ‘KICAD_SYS_SYMBOL_DIR’ is used for path declaration, but the corresponding environment variable is not set during the installation process.

Is there any value in setting the environment variable ‘KICAD_SYS_SYMBOL_DIR’ (like Kicad using it if it is set, otherwise it uses the legacy kicad.pro definitions) or should I even expect interferences with the path declaration from the ‘kicad.pro’ template when ‘KICAD_SYS_SYMBOL_DIR’ is set?

The answer from Wayne (@stambaughw) was:

The symbol library table is not in play yet. It will be soon. You
should continue to use the current schematic symbol library path search
until then.

Hope that helps.

If I make no mistake remembering other posts on the dev mailin list, the variable will be ‘activated’ and used with the release of Version 5.

2 Likes

I hope that works and will look at things more in the next few days. I’m trying to create a program that moves libraries and sets up folder paths and/or setup variables. I’m waiting to see how far the new library manager gets integrated into v5 and what it’s capabilities are.

I see six major setups to try to accommodate:

Standard library
Standard shared library
Shared library
Custom shared library
Custom user library
Project library

In addition, the standard and shared libraries may need root/admin permission to modify and update.

You can use environment variables in eeschema in V4 already. You need to change kicad.pro in order to get this configuration in all new projects. Existing projects need a bit of tinkering with notepad, since you can not put variable names in the project configuration directly from eeschema.

Look at: Environment user-defined variables: how to use them?

3 Likes