FindGLIB2.cmake

Alexander Neundorf neundorf at kde.org
Sun Sep 16 21:42:26 CEST 2007


On Saturday 01 September 2007 17:41, Allen Winter wrote:
> On Saturday 01 September 2007 10:36:27 am Allen Winter wrote:
> > On Saturday 01 September 2007 8:26:59 am Allen Winter wrote:
> > > On Friday 31 August 2007 7:01:20 pm Alexander Neundorf wrote:
> > > > On Friday 31 August 2007 15:50, Allen Winter wrote:
> > > > > Howdy,
> > > > >
> > > > > On my system,
> > > > > % pkg-config glib-2.0 --cflags
> > > > > -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> > > > >
> > > > > but FindGLIB2.cmake only sets
> > > > > GLIB2_INCLUDE_DIR:PATH=/usr/include/glib-2.0
> > > > >
> > > > > So how to get the missing /usr/lib/glib-2.0/include into the
> > > > > GLIB2_INCLUDE_DIR?
> > > >
> > > > Fixed and committed, the additional include directory is right now
> > > > optional, i.e. it doesn't fail if it is not found:
> > >
> > > Still not working for me.
> > >
> > > % grep GLIB2 CMakeCache.txt
> > > GLIB2_INTERNAL_INCLUDE_DIR:PATH=GLIB2_INTERNAL_INCLUDE_DIR-NOTFOUND
> > > GLIB2_LIBRARIES:FILEPATH=/lib/libglib-2.0.so
> > > GLIB2_MAIN_INCLUDE_DIR:PATH=/usr/include/glib-2.0
> > > //Search for GLIB2 package
> > > WITH_GLIB2:BOOL=ON
> > > //Advanced flag for variable: GLIB2_LIBRARIES
> > > GLIB2_LIBRARIES-ADVANCED:INTERNAL=1
> >
> > Seems to be because Alex is using /lib from GLIB2_LIBRARIES to build the
> > path to search for glibconfig.h.  When we need to be searching in
> > /usr/lib.
> >
> > This is actually a nightmare.  The more I look at it.

Does this mean libglib is in /lib, but the extra include dir 
is /usr/lib/glib-2.0/include ?
This sucks.

> > Shouldn't we be using 'pkg-config--cflags-only-I' to find a list of
> > includes to search in the PkgConfig macro?
> >
> > I spent at least an hour trying to make this work.  I'm ready to give up.
>
> For the record...
>
> I "fixed" the problem by adding /usr/lib and /usr/local/lib to the search
> path for glib-2.0/include/glibconfig.h

There is the cmake variable CMAKE_SYSTEM_LIBRARY_PATH, defined in 
Modules/Platform/UnixPaths.cmake and WindowsPaths.cmake, which could be added 
for this purpose instead of adding all the library paths one by one.

Alex, back from sunny California :-)


More information about the Kde-buildsystem mailing list