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