Using SCons with Eclipse (Linux)

I chose Eclipse as my new Linux IDE, instead of Konqueror + KWrite. The purpose was to be able to launch a SCons build from the IDE, get the errors in a panel and double-clicking on one of them would direct me to the location of the error.

So Eclipse seemed to fit my needs:

  • Plug-ins to add the support of various languages
  • Support of different construction tools
  • Support from the main C/C++/Fortran compiler developers (GNU, Intel, IBM, …)

So I will know show you two ways of enabling SCons support for Eclipse.

The first method is straightforward. Just create a new Program Builder and use SCons as the command. You can also add different paramters, if needed.

Using an external program to build Eclipse projects
Using an external program to build Eclipse projects

External program configuration panel
External program configuration panel

This method is usable with any Eclipse installation. The problem is that the errors are not reported.

The second solution is based on the CDT plugin. CDT offers several error parsers, and you can develop your own (for instance for Latex). You just need to replace make by scons. You can do this by telling Eclipse not to build its own makefile, but that you will handle everything. In the Behavior panel, you can also change the default arguments.

Using an alternate builder with CDT
Using an alternate builder with CDT

Selecting error parsers for SCons
Selecting error parsers for SCons

Then, you can pick the error parsers you need, depending on your compilers.

I’ve also tested this with Windows, but it failed: the Microsoft compilers were not recognized, although the compilation from a simple command line worked.

2 thoughts on “Using SCons with Eclipse (Linux)”

Leave a Reply