[CMake] Re: Help getting -l and -L arguments from apr-config
Matthew Woehlke
mw_triad at users.sourceforge.net
Thu May 3 13:24:24 EDT 2007
Alan W. Irwin wrote:
> On 2007-05-02 17:49-0500 Matthew Woehlke wrote:
>> I am trying to fix kdesdk's broken attempt to link to subversion (it
>> croaks when apr is not in a standard include path). I *do* have
>> apr-config accessible so I can use that to get the right paths, but
>> I'm having some trouble parsing --link-ld. Specifically, I am trying
>> to iterate over each option and set LIBRARIES or LIB_PATHS as
>> appropriate. Unfortunately this means I have to do something to split
>> the single string into arguments, and I would /prefer/ for it to do
>> proper shell splitting just in case an arg has a space in it.
>>
>> Is there a "right" way to do this? Or is there a better way to get
>> LIBRARIES and LIB_PATHS from apr-config? (Note: while apr-config is
>> found, pkg-config apr is not, so I can't use pkg-config :-(.)
>
> I assume that apr-config generates command-line results for the Apache
> Runtime Library similar to what pkg-config does in general. If that
> assumption is correct, then to parse the apr-config output you should
> follow
> what is done in FindPkgConfig.cmake (a replacement for
> UsePkgConfig.cmake in
> CMake cvs, but not released yet). I don't know the implementation details
> in FindPkgConfig.cmake, but I do know the pkg_check_modules macro in that
> module file delivers nicely parsed (and complete) pkg-config results.
I don't have FindPkgConfig.cmake handy, but UsePkgConfig.cmake uses
'pkgconfig --variable' which is not supported by apr-config. So I think
I still have the same problem, how to take a string that might look like
'-lfoo -lbar -L"foo bar/thelib"' and split it into '-lfoo', '-lbar' and
'-L"foo bar/thelib". From there I can use STRING to strip the flag and
SET/LIST to build the needed variables.
--
Matthew
Disadvantage: Bad Puns [-5]
You constantly utter puns so egregious as to cause mental distress to
anyone hearing them. This can, however, be used to distract enemies.
More information about the CMake
mailing list