Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Retrieving project library paths from within a plugin fails


I've asked on the newsgroups and got no answer so far.
Scanning the bug reports gave me no hint either.

I'm working on a CDT plugin that collects project information (includes,
sources, libraries) and writes that to the makefile structure for our
standard make projects. The reason for this is that we depend on
existing makefiles for now.

The idea is that the user sets the libraries (not only paths) in
'Properties/C/C++ General/Paths and Symbols/Library Paths' and
those entries are then written to the makefile. When I try to do
it similar to what I do with the includes (which works fine)
then it never returns any entries:

    ICProject project = ...
    ILibraryReference[] libraries = project.getLibraryReferences();
    // here libraries is always empty

I also tried a different approach found at

which does it like:

    ICProjectDescription projectDescription =

    ICConfigurationDescription activeConfiguration =

    ICFolderDescription folderDescription =

    ICLanguageSetting[] languageSettings =

    ICLanguageSetting lang = null;

    for (ICLanguageSetting setting : languageSettings) {

        if (setting.getLanguageId() != null) {
            if (setting.getLanguageId()
                .equalsIgnoreCase("org.eclipse.cdt.core.g++") ) {
                    ICLanguageSettingEntry[] libraryPathSettings =

                 System.out.println("Count: " +
                                   // Always zero aswell


but it also returns no library entries.

I am using Eclipse CDT (same build id).

Is the entry under 'Properties/C/C++ General/Paths and Symbols/Library
Paths' just a dummy that is not available in standard make projects,
or does anybody know what I did wrong?

Thank you for any help!


Back to the top