I think "pkg-config --cflags openscenegraph" may be missing required
include path /usr/X11R6/include/.

On OpenBSD-6.7 "pkg-config --cflags openscenegraph" outputs:
    -I/usr/local/include

But some openscenegraph headers end up including gl headers, which are
in /usr/X11R6/include.

Here's a minimal example of it going wrong:

osgtest.cpp:
    #include <osg/Camera>
    int main(void)
    {
    }

Compile command:
    c++ -c osgtest.cpp `pkg-config --cflags openscenegraph`

Output:
    In file included from osgtest.cpp:1:
    In file included from /usr/local/include/osg/Camera:17:
    In file included from /usr/local/include/osg/Transform:17:
    In file included from /usr/local/include/osg/Group:17:
    In file included from /usr/local/include/osg/Node:19:
    In file included from /usr/local/include/osg/StateSet:18:
    In file included from /usr/local/include/osg/StateAttribute:20:
    In file included from /usr/local/include/osg/Shader:25:
    In file included from /usr/local/include/osg/GLExtensions:18:
    In file included from /usr/local/include/osg/GLDefines:25:
    /usr/local/include/osg/GL:113:10: fatal error: 'GL/gl.h' file not found
    #include <GL/gl.h>
             ^~~~~~~~~
    1 error generated.

"locate GL/gl.h" shows: /usr/X11R6/include/GL/gl.h

This breaks Flightgear's cmake build on OpenBSD. I'm hoping to update
OpenBSD's Flightgear port at some point; i have it building ok using a
custom build script, but would be good to have it build using the
native cmake system.

One can add "pkg-config --sflags gl" to get the right flags - this
outputs "-I/usr/X11R6/include -I/usr/X11R6/include/libdrm". I guess
this should probably be unnecessary though? and certainly the
Flightgear cmake build works on other systems without it.


Thanks,

- Jules

-- 
http://op59.net


Reply via email to