<div dir="ltr"><div><br></div>For example: <a href="https://github.com/commontk/CTK/blob/ac13c32312c9160190b80bd3a03d012782eff40c/Libs/Core/CMake/ctkMacroBFDCheck.cmake#L33-43">https://github.com/commontk/CTK/blob/ac13c32312c9160190b80bd3a03d012782eff40c/Libs/Core/CMake/ctkMacroBFDCheck.cmake#L33-43</a><div>
<br></div><div style>Hth</div><div style>Jc</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 29, 2013 at 4:36 PM, Alexander Neundorf <span dir="ltr"><<a href="mailto:a.neundorf-work@gmx.net" target="_blank">a.neundorf-work@gmx.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Monday 29 April 2013, Philippe Cerfon wrote:<br>
> Hi.<br>
><br>
> I'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'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'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>
<br>
</div>If cmake finds the static version of the library, it should properly use that<br>
one.<br>
Making cmake find the static version instead of the dynamic version is kind of<br>
hard, AFAIK the only way to do this is to give the full filename of the static<br>
lib.<br>
<br>
Alex<br>
<div class="HOEnZb"><div class="h5">--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>+1 919 869 8849<br>
</div>