[CMake] putting object files in a seperate direcotry OR combining static libraries

Kiran Pradeep kiran.happy at gmail.com
Mon Dec 4 09:55:24 EST 2006


On 12/4/06, Alexander Neundorf <a.neundorf-work at gmx.net> wrote:
>
>
> Von: "Kiran Pradeep" <kiran.happy at gmail.com>
>
> > Hi All,
> >
> > I use cmake to in project with only 1 level of subdirectory.
> > In each of those subdirectories i have a CMakeLitst.txt which creates a
> > static library out of its source files and put them in a single common
> > directory.
> > Finally the main CmakeLists.txt will use all those lindividual static
> > libraries  to create the application.  Now there  is a requirement like,
> > i want to combine all those individual static libraries to a single
> > static or shared library. I know i have to run "ar x library.a"  to get
> > back the
>
> Is there a reason why you want to do that ?
> You can also simply set some variables which will contain the lists of
> source files, and then combine these to libs and apps as you want:
>
> set(foolibSrcs src1/foo.c src1/foo2.c)
>
> set(barlibSrcs src2/bar.c src1/bar2.c)
>
> add_library(foolib_static STATIC ${foolibSrcs})
> add_library(foolib_dyn SHARED ${foolibSrcs})
> add_library(barlib_dyn SHARED ${barlibSrcs})
> add_library(all_in_one SHARED ${foolibSrcs} ${barlibSrcs})
> add_executable(blub main.c ${foolibSrcs} ${barlibSrcs})



The project is too big to have a single file like that. That would confuse
things. Moreover different persons are working on different  libraries. They
will only give the library to me.

Bye
> Alex
>
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20061204/fd434a9c/attachment.html


More information about the CMake mailing list