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.
Variable | Descritption |
---|---|
CWD |
Points to the current working directory. |
PWD |
Points to the Project working directory. |
To add new Environment variable open (
).Click to the and New Variable
dialog appear.
Enter the new variable name and location. In location, you can use already defined environment variables. You can finish the process by click to .
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
and choose tab Tool SettingsFig. 3. Include path configuration -
Click to (Add..)
Fig. 4. New directory path -
Fill in the path to your source code with use of your previously defined variable and click 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.