Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Generating .cproject files

Clément Hurlin <clement.hurlin@xxxxxxxxxxxxx> wrote:

>  At my company (where we ship a secure kernel and applications on top
> of it), we would like to prepare packaged Eclipse installations for our
> clients and for that we need to generate cdt projects. However, the
> .cproject file (such as the one generated for a new "Makefile project
> with existing code") is pretty complex and seems to contain unique
> identifiers (numerical suffixes of Java packages).
>  Is it possible to call the .project/.cproject generator used by the
> UI, but from the command line ? If yes, it'd enable us to alter this
> file (add sourceEntries, definedSymbols, etc.) with specifics for our
> clients. I have experience developing Eclipse plugins but I'm new to the
> CDT environment.

I have never done this, so I can't give you a full solution, but some ideas:

- Take a look at the headless builder for a command-line environment that deals with CDT projects. I imagine you should be able to create projects in that context as well.
  https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java

- http://cdt-devel-faq.wikidot.com has some information on creating projects and their contents.

- There are many CDT unit tests that need to create (rudimentary) projects, you might find some useful code there, too.

I would advise against trying to generate .cproject files using any other mechanisms than CDT itself, for the reasons you have observed.

 -Christian



Back to the top