[CMake] how to build library for this..

Pau Garcia i Quiles pgquiles at elpauer.org
Thu Jan 29 07:50:20 EST 2009


On Thu, Jan 29, 2009 at 1:12 PM, ankit jain <ankitguddu at gmail.com> wrote:
> hi all,
>
> Problem:
>
> libA : A/foo.cc
> libB : B/bar.cc
> and a 3rd library:
> libC : A/foo.cc B/bar.cc
> ?
>
> here i build the libraries for A and B but not able to build lib for C .
> Guide me to do that. What should be the content of cmakelist file of C to
> create lib C
>
> here A and B are sub folders of C

Do you ean you are trying this but it's not working?

ADD_LIBRARY (libA A/foo.cc )
ADD_LIBRARY (libB B/bar.cc )
ADD_LIBRARY (libC libA libB )

That fails because CMake does not support convenience libraries:
http://www.cmake.org/Wiki/CMake_FAQ#Does_CMake_support_.22convenience.22_libraries.3F

You need to do this:

ADD_LIBRARY (libA A/foo.cc )
ADD_LIBRARY (libB B/bar.cc )
ADD_LIBRARY (libC A/foo.cc B/bar.cc )

I. e. list the source files for libC

Is that what you want to do?

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)


More information about the CMake mailing list