confusing CFLAGS example in manual

Peter Johansson trojkan at
Sat Jun 19 12:38:57 PDT 2010


In the example of a .pc file in the manual here
I noticed the line

Cflags: -I${includedir}/foo

which is a bit unexpected. Shouldn't it be

Cflags: -I${includedir}

If I install header files in ${includedir}/foo I expect users to include 
the header as

#include <foo/bar.h>

so no -cflags is needed when `bar.h' is installed in a standard location 
such as `/usr/include/foo'.

If, otoh, if `bar.h' is installed in a custom location, 
`${includedir}/foo/' such as `opt/include/foo/',  I still want to be able to

  #include <foo/bar.h>

In order for that to work I need to add `-I/opt/include' and not 
`-I/opt/include/foo' to the compiler arguments.

Am I missing somethings?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the pkg-config mailing list