confusing CFLAGS example in manual

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


Hi,

In the example of a .pc file in the manual here
http://people.freedesktop.org/~dbn/pkg-config-guide.html
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?

Thanks,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pkg-config/attachments/20100619/2ecafd6b/attachment.html>


More information about the pkg-config mailing list