Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Appending an include path

Hi Ben,

In case you simply need to programmatically add/remove/edit the path
entries settings, you could use the path entry API directly.
See the CoreModel.set/getRawPathEntries() methods.
Typically you would get the list of raw path entries using the
getRawPathEntries() method, modify it as needed and set it using the
setRawPathEntries() method. The new path entries should be created using
the CoreModel.new*Entry() methods.

In case you want to have your code be automatically called to provide
the necessary path entries, e.g. on project startup, etc. you can use
the org.eclipse.cdt.core.PathEntryContainerInitializer extension point
in conjunction with the CONTAINER path entry. This would allow your
initializer to be called (e.g. on a project startup) and supply the
necessary path entry settings by providing the PathEntryContainer to the
project. See the CoreMode.setPathEntryContainer() method.
To use the container initializer mechanism you should create a CONTAINER
PathEntry that that would hold the path of the format
"initializer.id/optional string your container could use" and add this
entry to the list of raw path entries.

Mikhail
 
-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Ben Monroe
Sent: Thursday, July 13, 2006 12:29 PM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Appending an include path

Greetings.

I would like to programmatically appending an include path to CDT.
I am aware of Mikhail Sennikovsky's recent comment about using
org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile and
then associating it with a toolChain::scannerConfigDiscoveryProfileId.
I am not using a Standard or Managed Project, nor is there a tool
chain; no compilation or make, either. I have a custom project and CDT
is only being used internally for parsing C++ code.
How can I append an include path to CDT? This path must be editable,
so I can not hard code it.
Is there a simple way, such as via a method call somewhere, to do it.
What are my options?
Or must I jump through all of the extension hoops?

Thanks.
Ben Monroe
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top