Author Topic: [linux] how to create custom run / execution command?  (Read 4543 times)

Offline zlieb

  • Single posting newcomer
  • *
  • Posts: 3
[linux] how to create custom run / execution command?
« on: August 19, 2007, 03:17:51 pm »

Hi,

I am currently trying to support code::blocks for this cross platform c++ library.

http://openframeworks.cc/download

one of the things about the exes that are compiled, is that they have to be run from a shell script that basically does this:

export LD_LIBRARY_PATH=$(pwd)/libs/

I can't for the life of me figure out how to alter the executing command in C::B so that it would run this shell script...

here's an example of the what I mean:

Executing: xterm -T 'moviePlayerExample' -e'LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH /usr/bin/cb_console_runner "/home/zach/codeBlocks/of_0.02_codeblocks/apps/moviePlayerExample/bin/Debug/moviePlayerExample" ' (in /home/zach/codeBlocks/of_0.02_codeblocks/apps/moviePlayerExample/.)

I have found this:

xterm -T $TITLE -e

in settings > environment settings > general settings

now my question is:

can I either:

a) alter this: LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH /usr/bin/cb_console_runner

b) alter the exe name which is run (and run my script instead)

c) alter this xterm script somehow to do something that might be helpful ?



also, are there project specific settings I can alter to help me do this?  I've been looking around alot, and online...

some people have the same questions I do:

http://www.rtsoft.com/forums/showthread.php?t=1731
http://forums.codeblocks.org/index.php?topic=6364.msg48846
http://www.ogre3d.org/phpBB2/viewtopic.php?t=25644&view=previous&sid=ce193664e1d3d7c4af509e6f4e2718c6


thanks for C::B

and thanks in advance for any help

take care
zach

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: [linux] how to create custom run / execution command?
« Reply #1 on: August 19, 2007, 07:02:38 pm »
You sure can alter all that in the sources.
But... can't you just use Morten's EnvVar plugin to set that variable and be done with it? If setting a variable is all extra functionality you need, that should do it.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: [linux] how to create custom run / execution command?
« Reply #2 on: August 19, 2007, 10:03:39 pm »
You sure can alter all that in the sources.
But... can't you just use Morten's EnvVar plugin to set that variable and be done with it? If setting a variable is all extra functionality you need, that should do it.
I'm not 100% sure about that but I'm afraid not.
The reason is simple: When the compiler starts at least 2 variables are setup: PATH and LD_LIBRARY_PATH. So whenever the EnvVars plugin sets these the compiler will overwrite them before the file gets compiled. I am aware of that issue and already have an idea how to change that without modifying the core... hence my time is very limited ATM as real live goes on.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ