[CMake] Help getting -l and -L arguments from apr-config
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Wed May 2 22:06:39 EDT 2007
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.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
More information about the CMake
mailing list