[CMake] linking with a .a file

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sat Sep 30 14:13:57 EDT 2006


On 2006-09-29 16:45+0200 Pierre Chifflier wrote:

> Hi,
>
> I am currently trying to convert my project (wzdftpd) to cmake. The last
> remaining problem is the following:
>
[...]
>
> If I use
>  TARGET_LINK_LIBRARIES (wzd_perl DynaLoader.a)
> Then cmake will convert it to:
>  -lDynaLoader
> which is wrong.

Actually -l (when combined with -L) is a standard way to specify libraries
(whether they are static or shared) to the linker.  To make sure cmake
generates the appropriate combination of -L and -l options, just specify the
full path to DynaLoader.a, i.e.,
/usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a.

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 Yorick front-end to PLplot (yplot.sf.net); 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