VARS.INI – An Easier Way to Add Variables
Recall that earlier in the lab you created two variables – a path variable and a build variable. They were the SAME variable set to the SAME path, but used in two different ways – one was for linking files into your project and the other was used for include search paths during the build.
The variables you created earlier were available on a project level. So, if you had two projects open in your workspace, the other project would NOT be able to use the variables that you created.
Now, we’ll show you how to add these variables almost automatically to your WORKSPACE so that ANY project in the workspace can use them.
Using vars.ini to set workspace path and build variables.
► Download vars.ini file and save it
► Select Window → Preferences. When the dialogue appears, ► type “linked” into the filter field as shown – then click on Linked Resources:
This displays all of your WORKSPACE level path variables. We set these variables at the PROJECT level before. We’re now ready to set them at the WORKSPACE level so that all projects in our workspace can use the same variables.
You could simply add the variable here manually, but importing them from vars.ini is simpler and will set BOTH variables at the same time.
► Type “variables” into the filter area and click on Variables as shown: This is where you can set WORKSPACE level build variables. Again, you could just add the variable now manually, but vars.ini will do this for us.
Both the Linked Resources and Build Variables areas for your workspace were BLANK – containing no workspace variables at all. That’s about to change…
► Click Cancel.
Let’s import the file vars.ini and see what happens….
► Select File → Import, then expand the CCS category, click on Build Variables (as shown):
► Click Next and browse to the location of vars.ini
► Click Open, then click Finish.
► Then select Window Preferences and locate your WORKSPACE path variable and your build variable. Did they show up? It should have imported the variable listed into both the path and build variable areas (as shown):
► Click OK. Minimize Code Composer.
Now, ANY project in your workspace can use these variables without any more importing. They are part of your workspace.