[CMake] portable way of linking (external) libs statically/dynamically/for dlopen
J Decker
d3ck0r at gmail.com
Mon Apr 29 19:54:01 EDT 2013
hard coded names aren't so bad, since they can be composed of dynamic
peices...
lib${CMAKE_LIBRARY_SUFFIX}/${CMAKE_SHARED_LIBRARY_PREFIX}c${CMAKE_SHARED_LIBRARY_SUFFIX}
or
lib${CMAKE_LIBRARY_SUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}c${CMAKE_STATIC_LIBRARY_SUFFIX}
to choose lib[64]/libc.so or lib[64]/libc.a (or it would generate
c.dll/c.lib for windows type compilers)
But, although you can generate portable projects that target lots of
platforms, the scripts still have to have things like
if( WIN32 )
if( UNIX )
etc...
On Mon, Apr 29, 2013 at 2:38 PM, Philippe Cerfon <philcerf at gmail.com> wrote:
> On Mon, Apr 29, 2013 at 10:40 PM, Jean-Christophe Fillion-Robin
> <jchris.fillionr at kitware.com> wrote:
> > For example:
> >
> https://github.com/commontk/CTK/blob/ac13c32312c9160190b80bd3a03d012782eff40c/Libs/Core/CMake/ctkMacroBFDCheck.cmake#L33-43
> I'm not sure whether I understand this correctly, or whether it is
> what I want ;)
> You still seem to hardcode the static library name (=> not portable)
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130429/4b8c5e5d/attachment.htm>
More information about the CMake
mailing list