[CMake] PKGCONFIG backward compatibility on CVS trunk.

Michel Hermier michel.hermier at gmail.com
Mon Dec 4 07:03:54 EST 2006


Hi,

I'm experiencing a string against list issue PKGCONFIG new code.

When using it we (in KDE) do things like:

PKGCONFIG(lib libIncDir libLinkDir libLinkFlags LibCFlags)
FIND_PATH(LIB_INCLUDE_DIR libfile.h ${linInkDir})
FIND_LIBRARY(LIB_LIBRARIES NAMES libnames ... PATH ${libLinkDir})

This was working for me until the upgrade of the pkgtool util.

It seems that the new pkgtool util return a string instead of a list, 
making the FIND_FOO methods fails in case of multiple path.
 From what I understand, calling ${BAR} doesn't produce the same number 
of arguments when expended, and for me it's sounds an unexpected behavior.
I mean, if I wanted it to be a single argument I would have done "${BAR}"

I attached a little CMakeLists.txt that show the behavior.
The case is simple I only assign one variable to one string, and one to 
a list containing the same content of the string.
And the output is different of the 2 calls is different, while I would 
expect to have the same output since I don't used "" in the macro call.

Is it something expected or did I miss something ?

Cheers,
   Michel
-------------- next part --------------

MACRO (dump)
  FOREACH (arg ${ARGN})
    MESSAGE(STATUS "Found arg: ${arg}")
  ENDFOREACH (arg)
ENDMACRO (dump)

set (FOO "foo bar")
dump (${FOO})

set (FOO foo bar)
dump (${FOO})


More information about the CMake mailing list