[CMake] portable way of linking (external) libs statically/dynamically/for dlopen
Philippe Cerfon
philcerf at gmail.com
Mon Apr 29 14:13:10 EDT 2013
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?
Cheers,
Phil
More information about the CMake
mailing list