Imagine++
Environment variables

Introduction

Environment variables are variables of the system, whose values are character strings. They are used mostly to indicate paths or preferences. In particular, the variable PATH indicates where to look when you launch an application from the command line (and also to find dynamic libraries, files with extension .dll, under Windows). PATH is thus a list of folders.

The other important variable concerning Imagine++ is Imagine_DIR, indicating the full path of the Imagine++ installation folder. Unless you choose a non-standard install location, this variable is not necessary under MacOS.

The variables relevant to Imagine++ are:

A portable way to deal with environment variables from QtCreator is the following:

qtcreatorSetenv.png
From the "Projects" tab on the left, you can view/change/add the environment variables.

However, this is only valid for the project at hand, to make it permanent, read on.

Setting variables under Linux and MacOS

In a terminal, the command env lists all known environment variables. To see the value of a variable, use echo $Imagine_DIR. If nothing is written, that means the variable Imagine_DIR is not set.

To set temporarily a variable, use the command

export Imagine_DIR=/usr/share/Imagine++

This value will be valid only for programs launched from this terminal. Other terminals will ignore it, as well as programs launched from the graphical environment.

Setting variables under Windows

In the Windows menu, right click on 'Computer' and select 'Properties' from the menu. In the left pane, click 'Advanced system settings' and press the button 'Environment Variables' in the new window. In the dialog, there are 'User variables', which you can set at will, and 'System variables' reserved for administrator.

envVar.png
Editing an environment variable

You can check the values by opening a command window (cmd.exe) and launching the command set.