<div dir="ltr"><div style>Ya; additional generators might be nice 'static runtime' or 'dynamic runtime' but that's only just the C runtime, and doesn'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 'static' 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'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"><<a href="mailto:philcerf@gmail.com" target="_blank">philcerf@gmail.com</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 Tue, Apr 30, 2013 at 1:54 AM, J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
> lib${CMAKE_LIBRARY_SUFFIX}/${CMAKE_SHARED_LIBRARY_PREFIX}c${CMAKE_SHARED_LIBRARY_SUFFIX}<br>
> or<br>
> lib${CMAKE_LIBRARY_SUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}c${CMAKE_STATIC_LIBRARY_SUFFIX}<br>
><br>
> to choose lib[64]/libc.so or lib[64]/libc.a (or it would generate<br>
> c.dll/c.lib for windows type compilers)<br>
><br>
> But, although you can generate portable projects that target lots of<br>
> platforms, the scripts still have to have things like<br>
><br>
> if( WIN32 )<br>
> if( UNIX )<br>
> etc...<br>
</div>Well exactly this is what I don't wan to do as it's not portable...<br>
_I_ (the developer) need to take care on any possible platorm, it'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'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 "link lib foo dynamic") 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>