During the build process you would have to hijack the selection of a new target, set your variable and then unset it upon another target is selected. It's the same way on run-level.
Well, exactly. For example on a target level there would be a listbox like Yiannis or Game_Ender suggested above.
The actual calling to wxSetEnv would be done either: on target select, or on target usage (eg. when the user clicks Build). And after the next target switch comes, unsetting the previous variables and setting the new ones.
Once you choose an application to run you would have to hijack the call of e.g. the console runner
Another option would be, when building the target, call it like in a batch file or console runner (running multiple programs in the same environment):
set var=value
gcc --the-rest
in linux using the
export equivalent.
I usually work on one target only and not on several in parallel. So why would I need so many options where to setup environment variables?
Well, I think Game_Ender gave the answer. It is not uncommon to use different env. vars in different targets, for example I have a project that haves targets GCC Release, GCC Debug, VC Release Unicode, etc, and some of the compiler/tools requiere different variables being set.