|
|
Re: Help setting CDT Indexer include path programmatically [message #829510 is a reply to message #821830] |
Mon, 26 March 2012 11:41 |
Slavian Petrov Messages: 2 Registered: March 2012 |
Junior Member |
|
|
Hi Raman,
I have a similar issue with my plugin.
After a search in the CDT sources I found something that is working for me in:
Project: org.eclipse.cdt.ui
Class: org.eclipse.cdt.internal.ui.wizards.settingswizards#readSettings()
This is finally how I made it:
IProject project = ...
ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(project, true);
ICConfigurationDescription configDecriptions[] = projectDescription.getConfigurations();
for (ICConfigurationDescription configDescription : configDecriptions) {
ICFolderDescription projectRoot = configDescription.getRootFolderDescription();
ICLanguageSetting[] settings = projectRoot.getLanguageSettings();
for (ICLanguageSetting setting : settings) {
if (!"org.eclipse.cdt.core.g++".equals(setting.getLanguageId()))
continue;
List<ICLanguageSettingEntry> includes = new ArrayList<ICLanguageSettingEntry>();
includes.addAll(setting.getSettingEntriesList(ICSettingEntry.INCLUDE_PATH));
includes.add(new CIncludePathEntry("/my/local/include/path", ICSettingEntry.LOCAL));
setting.setSettingEntries(ICSettingEntry.INCLUDE_PATH, includes);
}
}
CoreModel.getDefault().setProjectDescription(project, projectDescription);
[Updated on: Mon, 26 March 2012 11:56] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04483 seconds