12

My company has traditionally used a Linux command line development environment. We use a script to manage the PATH and LD_LIBRARY_PATH environment variables when compiling and running. This script is called by adding it to the beginning of a command, like this:

sbs make
sbs ../bin/foo.exe

I am trying to get our code to run from Eclipse CDT, and move us forward a decade or so in development tools. I can control what the make command is in a build configuration, but I haven't figured out how to control the executable command in a run configuration. Is such a thing possible? Or will we have to set the environment variables in the run configuration, instead of relying on the script to do so. The intention of the script was to minimize the work when building for different versions of GTK or when building on different platforms (Linux, Solaris, etc...).

Scottie T
  • 11,729
  • 10
  • 45
  • 59

2 Answers2

6

Hmmm, are you looking for the "environment" tab under "External Tools Configuration" (the "Play" button with the red toolbox)?

alt text

If that's not what you are looking for, please disregard my commment.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
jldupont
  • 93,734
  • 56
  • 203
  • 318
  • Deleted my previous comment because I spoke too soon. By envoking Eclipse with the script, then using an external tool configuration, I get my stuff to run! Thanks, bro! – Scottie T Oct 13 '09 at 15:11
1

To set your custom build environment:

Project Properties->C/C++ Build->Environment

To execute your program

Project Properties->Run/Debug Settings->New

Enter variables in Environment tab in Launch Configuration. Click on 'Common' tab and check Shared File radio button and check in the launcher configuration with your project.

If you want to run other programs with your build (say some pre/post processor), add a new builder with:

Project Properties->Builders->New
Alexander Pogrebnyak
  • 44,836
  • 10
  • 105
  • 121
  • 1
    Thanks. I knew how to set environment variables, but I didn't want to go through the pain of setting those manually. I needed to be able to run my script in the same breath as running my program, which sets those variables for me. – Scottie T Oct 13 '09 at 16:30