News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

"Source" my environment

Started by anothrguitarist, February 08, 2008, 07:49:00 AM

Previous topic - Next topic

anothrguitarist

Platform: Ubuntu 7.10

I'd like to start using code::blocks as my IDE, but there is something I need to figure out. Apparently, I need to "source" my environment in order to build certain programs. I am able to build the programs with a make file, however, if I enter the following command in terminal:

$. environ.sh

Unfortunately, I don't know how to setup code::blocks to run this command before it builds my programs. Does anyone know how I could do this? Any help would be appreciated.


JGM

A guitarist! Same as me  :)

You could try by going to Project -> Build Options -> Pre/post build steps.
There you can execute commands.

Good Luck!

Jenna

What about setting the variables in "Settings -> Environment settings -> Environment variables" ?
In the projects properties dialog you can chose which envvars-set you want to be used for the actual project.
I never used this functionality, but if I understand the dialog right it should also work.

MortenMacFly

Quote from: jens on February 08, 2008, 02:53:10 PM
I never used this functionality, but if I understand the dialog right it should also work.
Right - this is what I would propose to try, too. Although this requires you to setup the envvars you setup via script within the envvars plugin of C::B, too. but you could possibly get rid of the shell scripts then. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

anothrguitarist

Thanks for the input, but I figured out how to do it last night, after a few days of hard work. What I had to do was run open terminal and source my environment, and then run code::blocks from the same console window.

I.E.
$. /directoryhere/environ.sh
$codeblocks

Thanks and regards