[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-dev] Question on programatically adding an include to CDT projects
|
Hello,
I've been stuck on this issue for a while now. I'm attempting to
add a library and an include entry for a CDT-based project. I do
this in the project creation wizard, after overriding performFinish()
in a subclass of NewManagedCCProjectWizard using what I've come across
in a few instances (just the includeEntry code for now):
IPathEntry[] entries = cProject.getRawPathEntries();
List<IPathEntry> newEntries = new ArrayList<IPathEntry>(Arrays.asList(entries));
IIncludeEntry incEntry =
CoreModel.newIncludeEntry(newProject.getFullPath(), new
Path("C:\\gsroot\\include\\systemc"), new Path("./"), false);
newEntries.add(incEntry);
CoreModel.setRawPathEntries(cProject, (IPathEntry[]) newEntries.toArray(new IPathEntry[newEntries.size()]), null);
CoreModel.validatePathEntry(cProject, incEntry, true, true);
When executing, this adds the include path to the C/C++ Project view
under the Includes container; however, attempting to compile will
fail. I've noticed that this directory is not being added to the
subdir.mk file.
Am I missing something blatently obvious? Or is there another way I should be going about this.
Thank you in advance,
Nick