User forums > Help

Adding a path to PATH variable per project

(1/1)

effemmeffe:
I'd like to modify the windows global variable PATH on a per project basis.
So when I compile a project I can have a modified PATH variable.
I can't figure out how to do that, can someone help me, please?
TIA

MortenMacFly:

--- Quote from: effemmeffe on August 31, 2012, 04:30:56 pm ---I can't figure out how to do that, can someone help me, please?

--- End quote ---
Use the EnvVars plugin, it has per-project specific options.

effemmeffe:
Thanks.
I tried, but I can't get it work and I can't figure out what I'm doing wrong...

I have a windows machine and I'm trying to compile a GTK+ program.
My GTK+ is installed in c:\programmi\gtk+ and I'd like to add that path to the global path so I can use pkg-config to add the needed libraries for my project.

In C::B settings->environment->environment variables I set up a new envvar set called gtk in which I put the line:
PATH = %PATH%;c:\programmi\gtk+\bin

Then in the Envvars options of my project I select the set I just created.

To test I wrote a simple batch file containing just the command PATH and I run it as pre-build step in my project build option.
Now in the build log I have the output of the windows command PATH and I can't see the added path c:\programmi\gtk+\bin.

Where is my mistake?

MortenMacFly:

--- Quote from: effemmeffe on September 03, 2012, 10:55:38 am ---Where is my mistake?

--- End quote ---
Enable the debug option in the envvar plugin, then run C::B with the "--debug-log" flag and see what happens for yourself in the debug log. I'll try myself once I find the time...

effemmeffe:
It worked!
To do what you suggested I had to close C::B and restart it via command line.
Once I restarted C::B I didn't have to change anything, I tried to recompile and now the PATH is correct.

Navigation

[0] Message Index

Go to full version