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

Goswin von Brederlow brederlo at informatik.uni-tuebingen.de
Sat Sep 15 16:02:53 EDT 2007


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


More information about the CMake mailing list