Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to set include paths programmatically?

Hi George,
Include path is a tool (compiler) option. You need too get tool's options, find one with appropriate name
and call configuration.setOption(tool, option, value):

for (ITool t : config.getToolChain().getTools() ) {
                   if ( t.getId().contains("c.compiler") ) {
IOption o = t.getOptionById("gnu.c.compiler.option.include.paths");
... // setup paths ArrayList
config.setOption(t, o, paths.toArray(new String[]{}));
}




George Russell wrote:
Hi all,

I am wondering how I can set the CDT's include paths either programmatically or in a configuration file?


At the moment, the include lines of source files are reported as warnings in the CDT editor, and I'd like to avoid forcing users to set up paths manually when it can be automated or pre-set.

Regards,
George

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



Back to the top