First of all what might make things worse is that shell commands differ
across OS's and this must be kept cross-platform.
Currently the OS is first checked and then the right pkg-config commands
find include paths, lib paths and libs + other gcc flags for given
package. Then the output is parsed to remove options (-I, -l, -L) and
form a list(s).
To make things easier a list of available packages are shown on a
property page. Checking a package executes necessary commands on the
background. The current design doesn't involve any knowledge of shell
commands from the end-user which I personally like.
Your idea of a more general approach sounds good but did you know that
you can already input commands directly to compiler? The only drawback
is that some shell commands of Unix tools don't work on Windows (e.g.
back ticks).
Maybe I miss something here.
Petri
On 27.5.2011 16:53, GK wrote:
> I am willing to test/use when ready
>
> thoughts
>
> Do you think this might introduce a design consideration on the output
> of pkg-config
>
> It's possible that there may be/may arise other toolkit frameworks
> that also rely upon an external command to provide includes, libs,
> compiler and linker flags via a local command output. It is possible
> to design so that the CDT interface is pkg-config command unaware
>
> A newline(LF) separated list could be a external command independent
> input format via some input in the CDT properties dialog.
>
> The following option can easy gleaning of include directories
> pkg-config --cflags-only-I gtkmm-30
> lists only include dir flags
>
> pkg-config --cflags-only-I gtkmm-3.0 | sed -e "s/-I//g" | xargs -n 1
> echo
> generates a list of directories, one on each line
>
> subQ) What if GTK, gtkmm are installed in a path with a 'space' in it
> as C:\program Files\GTK\include
> what is pkg-config output in that situation ?
>
Yet to be tested.
I guess I could additionally use build variables, but generally I think
it's better if users can find the values added to tools as well (Paths
and Symbols tab). This is what users expect in my opinion. I will look
into it if the indexer is unable to resolve the values without using the
build variables.
FYI: Additionally you could post your ideas to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=44761 where this
pkg-config support feature is discussed amongst CDT developers. However
I am the only one to develop this but it sure helps if there is
discussion going on.
Petri