[CMake] PKGCONFIG backward compatibility on CVS trunk.

Michel Hermier michel.hermier at gmail.com
Tue Dec 5 12:31:48 EST 2006


David Cole wrote:
> On 12/4/06, *Michel Hermier* <michel.hermier at gmail.com 
> <mailto:michel.hermier at gmail.com>> wrote:
>
>     set (FOO "foo bar")
>     dump (${FOO})
>
>
> Here FOO is a string that contains a space...
>  
>
>     set (FOO foo bar)
>     dump (${FOO})
>
>
> Here FOO is a list with two elements. If it were printed as a string 
> it would be "foo;bar"
>
> HTH,
> David
>
I know that (thought I find it not intuitive) but the problem this
expose is that the returned arguments from the arguments for PKGCONFIG
compatibility macro (at minimum) are invalids the usage done in most of
the Find*.cmake script (like in KDE).
If you look at what is done in the FindLibXml2.cmake and
FindLibXslt.cmake there is obviously something wrong. The returned
string from PKGCONFIG is used directly for FIND_PATH and FIND_LIBRARY.
Since the returned arguments are string containing the whole enumeration
of path (for some package with dependency there can be a lot) the path
matched string looks like " /foo /bar /bla" instead of behind
interpreted as a list of potential paths that would get printed as
";/foo;/bar;/bla". Is there a macro to split a string to a list, so that
the compatibility macro at least could get fixed ?
Maybe a utility commands like STRING SPLIT/JOIN should be added for that
? and maybe there are other more usage for it ?

Cheers,
    Michel





More information about the CMake mailing list