Environment variables

An environment variable is a dynamic-named value that can affect the way running processes behave. They are part of the environment in which a process runs.

In some cases, the use of environment variables can help you with the project configuration. For example, when you want to add several include paths having the same root directory. The following section describes some technics which can help you to deal with such cases.

Tab. 1. Default Environment variables defined by HighTec IDE
Variable Descritption

CWD

Points to the current working directory.

PWD

Points to the Project working directory.

To add new Environment variable open (Project  Properties  C/C++ Build  Environment).

ide environment variable
Fig. 1. Path variables

Click to the btnAdd dot and New Variable dialog appear.

ide new environment variable
Fig. 2. New environment variable

Enter the new variable name and location. In location, you can use already defined environment variables. You can finish the process by click to btnOk.

PRACTICAL USE CASE

Once you define new variable pointing to your source folder, you can add include path to your project settings by following these points:

  • Open include path configuration from menu Project  Properties  C/C++ Build  Settings and choose tab Tool Settings

    ide new include path
    Fig. 3. Include path configuration
  • Click to add button (Add..)

    ide add directory path
    Fig. 4. New directory path
  • Fill in the path to your source code with use of your previously defined variable and click btnOk to finish the process.

Now, when the base location of the submodule1 and submodule2 change, it is enough to update MY_SOURCE_PATH variable accordingly, and the path is working again.