[CMake] Re: new pkgconfig stuff

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Thu Nov 23 09:35:16 EST 2006


frederic heem <frederic.heem at telsey.it>
writes:

> According to the module guideline, the variable XXX_DEFINITIONS is
> missing,

I do not have an idea how to realize it. E.g. parsing something like

| -DFOO=\"A string with spaces\"

requires more than some simple regex's.


I split the libraries and include components, because 'pkg-config'
provides the corresponding *-only-* options. But the splitting itself
does not make much sense; e.g. LDFLAGS of

| -Wl,--as-needed -lfoo -lbar ... -Wl,--no-as-needed

must be used as a whole and not in something which results into

| ... -lfoo -lbar -Wl,--as-needed -Wl,--no-as-needed


> is it replace with XXX_CFLAGS or XXX_CFLAGS_OTHERS ?

XXX_CFLAGS contains the '-I...' options, while XXX_CFLAGS_OTHERS not. This
reflects the effect of pkg-config's '--cflags' and '--cflags-only-others'
option.


> Is it also possible to set the environment variable PKG_CONFIG_PATH?

No; use

| cmake ... -DPKG_CONFIG_EXECUTABLE="foobar"

instead of


> Do it handle the case when "pkg-config --cflags-only-I dbus-1" returns
> multiple path ?

On my system, it defines

| DBUS_CFLAGS:INTERNAL=-I/usr/include/dbus-1.0;-I/usr/lib/dbus-1.0/include
| DBUS_CFLAGS_I:INTERNAL=
| DBUS_CFLAGS_OTHER:INTERNAL=
| DBUS_FOUND:INTERNAL=1
| DBUS_INCLUDEDIR:INTERNAL=/usr/include
| DBUS_INCLUDE_DIRS:INTERNAL=/usr/include/dbus-1.0;/usr/lib/dbus-1.0/include
| DBUS_LDFLAGS:INTERNAL=-ldbus-1
| DBUS_LDFLAGS_OTHER:INTERNAL=
| DBUS_LIBDIR:INTERNAL=/usr/lib
| DBUS_LIBRARIES:INTERNAL=dbus-1
| DBUS_LIBRARY_DIRS:INTERNAL=
| DBUS_LIBS:INTERNAL=
| DBUS_LIBS_L:INTERNAL=
| DBUS_LIBS_OTHER:INTERNAL=
| DBUS_LIBS_PATHS:INTERNAL=
| DBUS_PREFIX:INTERNAL=/usr
| DBUS_VERSION:INTERNAL=0.61

plus some *_STATIC_* variables.




Enrico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 480 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20061123/8025a1c2/attachment.pgp


More information about the CMake mailing list