[CMake] creating a library from other one

Stéphane Ancelot sancelot at numalliance.com
Fri Aug 31 10:41:37 EDT 2018



Le 31/08/2018 à 16:31, Eric Noulard a écrit :
>
>
> Le ven. 31 août 2018 à 15:59, Stéphane Ancelot 
> <sancelot at numalliance.com <mailto:sancelot at numalliance.com>> a écrit :
>
>     I ended with :
>
>     add_custom_target(combined ALL
>        COMMAND ${CMAKE_AR} rc libcombined.a $<TARGET_FILE:lib1>
>     $<TARGET_FILE:lib2>)
>
>
> Quick & dirty :-)
> There is the "thin" option of ar as well: 
> https://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one
> if you know the content of lib1 and lib2 don't have name clash.
>
> However libcombined.a is not a proper library target for CMake now.
>
> And by the way does this work on Window too ? Or may be you don't care ?
>
>
>
This is on linux and i will take care of windows too.
> -- 
> Eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180831/a0c2af01/attachment.html>


More information about the CMake mailing list