[CMake] Creating a static lib from other static libs, HOW?

Juan Sanchez Juan.Sanchez at amd.com
Sun Sep 16 23:38:14 EDT 2007


Hello,

The ar command can be used to extract the .o files from a .a file.
Extracting them all into the same directory, perhaps you can use some
file globbing to find all the objects and add them to another archive.

Juan

Goswin von Brederlow wrote:
> Hi,
> 
> another problem. I have the following structure in my source (trimmed
> down):
> 
> core/
> core/console/
> core/console/console.c
> core/util/
> core/util.c
> core/other-stuff.c
> 
> Now I'm building
> 
> core/console/libconsole.a
> core/util/libutil.a
> 
> 
> But how do I link libutil.a and libconsole.a into a combined
> libcore.a? I tried setting
> 
> ADD_LIBRARY(core other-stuff.c util console)
> TARGET_LINK_LIBRARIES(core util console)
> SET(CMAKE_STATIC_LINKER_FLAGS "-Lutil -Lconsole -lutil -lconsole")
> 
> but no luck. They all get completly ignored.
> 
> Any ideas?
> 
> MfG
>         Goswin
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 
> 


-- 
Juan Sanchez
Juan.Sanchez at amd.com
800-538-8450 Ext. 54395
512-602-4395




More information about the CMake mailing list