Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Removing built-in include paths / macros programmatically not working

Title: Removing built-in include paths / macros programmatically not working

Hello guys,

I have figured out how to delete include paths / macros through using ResourceDescription/LanguageSetting …

My problem now is : I use the auto discovery to determine some include paths from a log file. Now I want to delete those determined (built-in) and all other setting entries but it is not working with this code:

      ICProjectDescription cProjectDescr = CCorePlugin.getDefault().getProjectDescription(project, true);
      for (ICConfigurationDescription cConfigDescr : cProjectDescr.getConfigurations()) {
          ICResourceDescription[] resDescrs = cConfigDescr.getRootFolderDescription().getNestedResourceDescriptions();
          for (ICLanguageSetting cLngSetting : cConfigDescr.getRootFolderDescription().getLanguageSettings()) {
            cLngSetting.setSettingEntries(ICSettingEntry.INCLUDE_PATH, new ICLanguageSettingEntry[0]);
            cLngSetting.setSettingEntries(ICSettingEntry.MACRO, new ICLanguageSettingEntry[0]);
          }
          for (ICResourceDescription resDescr : resDescrs) {
            cConfigDescr.removeResourceDescription(resDescr);
          }
      }

      // Set switch that these settings are always valid for the active configuration
      cProjectDescr.setConfigurationRelations(ICProjectDescriptionPreferences.CONFIGS_LINK_SETTINGS_AND_ACTIVE);
      CoreModel.getDefault().setProjectDescription(project, cProjectDescr);



Any advice from you?

Kind regards
Marko Tomljenovic


Back to the top