User forums > Help
auto set environement variables [solved]
(1/1)
ccdric:
Hello evrybody,
... and appy new year :)
(hope this won't be a double post. I lost strangely my first try to post)
anybody know how to set env var automaticly at code::blocks startup ?
I'm talking about menu : settings/environement/Environement variables.
In the last stable release 17.12 the env vars were set at CB startup.
With my nightbuilds (first with realease 11736, now with 11927), I have to click each startup on the settings/environement/Environement variables/"set now" button !!
My env var are in a named set : "myclient" (it's not the "default" one).
this is extracted from my conf file (looks like the "myclient" set is the active one at startup)
--- Code: ---
...
<envvars>
<sets>
<default />
<myclient>
<ENVVAR0>
<str>
<![CDATA[1|CLIENTSDIR|/home/cedric/Documents/devellopement/myclient/clients]]>
</str>
</ENVVAR0>
<ENVVAR1>
<str>
<![CDATA[1|SCRIPTS|/home/cedric/Documents/devellopement/myclient/clients/scripts]]>
</str>
</ENVVAR1>
....
<ENVVAR19>
<str>
<![CDATA[1|PRJROOT|/outils/glob]]>
</str>
</ENVVAR19>
</myclient>
</sets>
<ACTIVE_SET>
<str>
<![CDATA[myclient]]>
</str>
</ACTIVE_SET>
<DEBUG_LOG bool="1" />
</envvars>
...
--- End code ---
I can stil live like this but I'll be happy if someone can help me to automate this feature.
thanks
oBFusCATed:
Have you tried to select the env vars set in your project/target? If you do so they should be set automatically.
ccdric:
Thanks for your answer.
so I looked in project/properties in "EnvVars option" tab
* env var select is checked
* myclient is selected
try to quit CB
run again CB,
... compile my project failded
go to the settings/environement/Environement variables and click "set now" button ( of course "myclient" env var set is selected)
... compile OK
(of course compile uses env vars)
so I gess something didn't works with project vars assignement and/or global vars assignment.
someone else has the same issue ?
did I miss something ?
MortenMacFly:
--- Quote from: ccdric on January 02, 2020, 02:23:26 pm ---go to the settings/environement/Environement variables and click "set now" button ( of course "myclient" env var set is selected)
... compile OK
--- End quote ---
This used to work. Maybe something got broken. Could you please enable the envvar debug option (settings->environment->envvar->checkbox at the bottom "Enable full envvar debug output...").
Then, close/restart C::B again an run you compilation (just as you described). Inspect the debug log and see if the envvars are really set and if the right set is chosen.
Please report back. Thank you!
ccdric:
Thanks MortenMacFly for your answer,
I did the test you asked to me
so i find that the init setup of env var was a little bit different from the second one.
one envVar was not at the right place, (depending from an other one).
that's why the second envVars setup vas good, not the first one.
Now I put the envVars in the good order and evrithink's OK.
tanks for all and sorry for my mistake.
Navigation
[0] Message Index
Go to full version