<div dir="ltr"><div style>Ya; additional generators might be nice &#39;static runtime&#39; or &#39;dynamic runtime&#39; but that&#39;s only just the C runtime, and doesn&#39;t account for the uncounted other libraries you may also depend on.  </div>
<div style><br></div><div style>Although I suppose it would make sense that if it was &#39;static&#39; that all other related things should also be static; instead of choosing specifically each one on a case-by-case basis.</div>
<div style><br></div><div style>Or maybe a different CMAKE_BUILD_TYPE .. debug, debug_static, etc...</div><div style><br></div><div style>maybe that&#39;s an option to add_executable( target STATIC sources )  (static works for add_library() to choose a specific mode)</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 29, 2013 at 6:44 PM, 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"><div class="im">On Tue, Apr 30, 2013 at 1:54 AM, J Decker &lt;<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>&gt; wrote:<br>

&gt; lib${CMAKE_LIBRARY_SUFFIX}/${CMAKE_SHARED_LIBRARY_PREFIX}c${CMAKE_SHARED_LIBRARY_SUFFIX}<br>
&gt; or<br>
&gt; lib${CMAKE_LIBRARY_SUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}c${CMAKE_STATIC_LIBRARY_SUFFIX}<br>
&gt;<br>
&gt; to choose lib[64]/libc.so or lib[64]/libc.a  (or it would generate<br>
&gt; c.dll/c.lib for windows type compilers)<br>
&gt;<br>
&gt; But, although you can generate portable projects that target lots of<br>
&gt; platforms, the scripts still have to have things like<br>
&gt;<br>
&gt; if( WIN32 )<br>
&gt; if( UNIX )<br>
&gt; etc...<br>
</div>Well exactly this is what I don&#39;t wan to do as it&#39;s not portable...<br>
_I_ (the developer) need to take care on any possible platorm, it&#39;s<br>
library naming conventions and possibly also on any compiler/linker<br>
suite I want to support...<br>
If the responsibility for this falls back to me, I can also build via<br>
shell script (more or less).<br>
<br>
What I&#39;d like to have is:<br>
1) My CMakeLists checks for all dependencies (e.g. lib foo) using the<br>
CMakes functions for that.<br>
These functions should tell me which versions were found (i.e. static<br>
or shared).<br>
2) Depending on (1) I set CMake options cache with reasonable defaults<br>
(i.e. in most cases this will be &quot;link lib foo dynamic&quot;) for each lib<br>
foo.<br>
For some I might even offer to use dlopen(), depending on whether my<br>
sources support this.<br>
3) The user can then chance that settings per lib in the cache as he likes.<br>
4) When I say target_link_library... I want to set some flag (static<br>
vs. shared) depending on what was chosen in (3) (or not link at all in<br>
case of dlopen()),<br>
<br>
Everything else, platform naming conventions, compiler/linker options,<br>
should happen automatically (for all supported platforms +<br>
compilter/linker suites)... that would be portability.<br>
<br>
<br>
Cheers!<br>
</blockquote></div><br></div>