views:

76

answers:

2

we work under Linux/Eclipse/C++ using Eclipse's "native" C++ projects (.cproject). the system comprises from several C++ projects all kept under svn version control, using integrated subclipse plugin.

we want to have a script that would checkout, compile and package the system, without us needing to drive this process manually from eclipse, as we do now.

I see that there are generated makefile and support files (sources.mk, subdir.mk etc.), scattered around, which are not under version control (probably the subclipse plugin is "clever" enough to exclude them). I guess I can put them under svn and use in the script we need.

however, this feels shaky. have anybody tried it? Are there any issues to expect? Are there recommended ways to achieve what we need?

N.B. I don't believe that an idea of adopting another build system will be accepted nicely, unless it's SUPER-smooth. We are a small company of 4 developers running full-steam ahead, and any additional overhead or learning curve will not appreciated :)

thanks a lot in advance!

+2  A: 

I would not recommend putting things that are generated in an external tool into version control. My favorite phrase for this tactic is "version the recipe, not the cake". Instead, you should use a third party tool like your script to manipulate Eclipse appropriately to generate these files from your sources, and then compile them. This avoids the risk of having one of these automatically generated files be out of sync with your root sources.

I'm not sure what your threshold for "super-smooth" is, but you might want to take a look at Maven2, which has a plugin for Eclipse projects to do just this.

John Feminella
thanks! a quick look at what is Maven page shows "a tool that can now be used for building and managing any Java-based project". Is it good for C++ projects?
davka
Maven itself is built with Java, but it can manage and build pretty much any project format under the sun that's in widespread use.
John Feminella
+1  A: 

I know that this is a big problem (I had exactly the same; in addition: maintaining a build-workspace in svn is a real pain!)

Problems I see:

  • You will get into problems as soon as somebody adds or changes project settings files but doesn't trigger a new build for all possible platforms! (makefiles aren't updated).
  • There is no overall make file so you can not easily use the build order of your projects that Eclipse had calculated

BTW: I wrote an Eclipse plugin that builds up a workspace from a given (textual) list of projects and then triggers the build. That's possible but also not an easy task. Unfortunately I can't post the plugin somewhere because I wrote it for my former employer...

rstevens