[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] portable way of linking (external) libs statically/dynamically/for dlopen
From:       Ian Monroe <ian () monroe ! nu>
Date:       2013-04-29 18:30:29
Message-ID: CAHh0A5XQXS5m2RD=MuDU8kV7ZG4mPwiGfT_5cnvJ1mMHpDC5FQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Mon, Apr 29, 2013 at 11:13 AM, Philippe Cerfon <philcerf@gmail.com>wrote:

> Hi.
>
> I've always thought one of the main objectives of cmake was being
> portable, right?
> So I was looking for a way to let the user (i.e. the person building a
> project) choose how he wan't to link each external library (i.e. not
> the ones built as targets by my project), depending on what that lib
> supports and (when my own code supports it:) dynamically loaded via
> e.g. dlopen.
>
> But it seems that I cannot even tell CMake (in a portable way) that it
> should use static or dynamic linking for some external lib (not to
> talk about the core libs like libc or libstdc++).
> Of course I can work around this any manually search for e.g. .so and
> .a files... but that woudln't be portable anymore... not to talk about
> different linkage options per linker... so ideally CMake should (IMHO)
> take care of all this (for each supported platform/linker).
>
>
> Am I missing something? Or is that just som major deficiency in the
> portable-part?
>

Static linking of external libraries is just a weird thing to do.

Ian

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 29, 2013 at 11:13 AM, \
Philippe Cerfon <span dir="ltr">&lt;<a href="mailto:philcerf@gmail.com" \
target="_blank">philcerf@gmail.com</a>&gt;</span> wrote:<br> <blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br> <br>
I&#39;ve always thought one of the main objectives of cmake was being<br>
portable, right?<br>
So I was looking for a way to let the user (i.e. the person building a<br>
project) choose how he wan&#39;t to link each external library (i.e. not<br>
the ones built as targets by my project), depending on what that lib<br>
supports and (when my own code supports it:) dynamically loaded via<br>
e.g. dlopen.<br>
<br>
But it seems that I cannot even tell CMake (in a portable way) that it<br>
should use static or dynamic linking for some external lib (not to<br>
talk about the core libs like libc or libstdc++).<br>
Of course I can work around this any manually search for e.g. .so and<br>
.a files... but that woudln&#39;t be portable anymore... not to talk about<br>
different linkage options per linker... so ideally CMake should (IMHO)<br>
take care of all this (for each supported platform/linker).<br>
<br>
<br>
Am I missing something? Or is that just som major deficiency in the<br>
portable-part?<br></blockquote><div><br></div><div>Static linking of external libraries is just a weird \
thing to do.<br><br></div><div></div><div>Ian<br></div></div></div></div>



--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic