[CMake] Replacing -L with -l

Phillip Hellewell sshock at gmail.com
Fri Jun 9 12:26:03 EDT 2006


On 6/9/06, Jorgen Bodde <solidstl at xs4all.nl> wrote:
>
> Hi Alex,
>
> Thank you for your reply. I want to statically link as much libs as
> possible (especially wxGTK2.6.3) .. The reason is that my app needs to
> distributed. When I have wxGTK2.6.1 installed in /usr/lib it always
> takes those instead of my own absolute path.
>
> I do not really mind if it is portable or not, I just want GCC to take
> the proper libraries. And I feel limited now because I do have wxGTK
> 2.6.1 installed as RPM (in /usr/lib) because it is needed by some apps,
> but I cannot even link against my own built wx-libs (located somewhere
> else) because GCC always takes the .so versions in /usr/lib. To me that
> sounds rather limiting.
>

Here is a trick I learned.  Just make a directory, for example
/usr/lib/static, and create symbolic links in there that point to the
libraries you want to link statically.

Then all you need is a LINK_DIRECTORIES( /usr/lib/static ), and thenit will
pick those static libraries first.

Phillip Hellewell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060609/d7ba7279/attachment.html


More information about the CMake mailing list