[CMake] Embedding static library in shared object library

Mateusz Loskot mateusz at loskot.net
Wed Nov 17 06:41:11 EST 2010


On 17/11/10 11:33, santosh mahto wrote:
> Hi all Q:-i have a 3 static library(say A.a B.a C.a) and i want to
> create my final library as .so (say Main.so ) which link + embedd all
> three Library.i tried TARGET_LINK_LIBRARIES but it only links to A.a
> B.a C.a.and dosnt append it.I want my final binary(Main.so) to
> include(or embedd) all three static library(already compiled with
> --fpic). Please Tell  me the correct solution for this dilemma.

"""
Combining static libs into a shared lib is not really portable, you have
to take care that you use the correct linker flags for the libs so that
it will work.
"""

http://www.cmake.org/pipermail/cmake/2008-March/020315.html

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org


More information about the CMake mailing list