On Monday 29 April 2013, Philippe Cerfon 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?

If cmake finds the static version of the library, it should properly use that 
one.
Making cmake find the static version instead of the dynamic version is kind of 
hard, AFAIK the only way to do this is to give the full filename of the static 
lib.

Alex
--

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

Reply via email to