[CMake] Re: Convenience libraries

Alexander Neundorf a.neundorf-work at gmx.net
Fri Jul 7 16:23:21 EDT 2006


Von: John Ellson <ellson at research.att.com>

> Brad King wrote:
> >
> > I've just added it to the FAQ:
> >
> >
> http://www.cmake.org/Wiki/CMake_FAQ#Does_CMake_support_.22convenience.22_libraries.3F 
> >
> >
> > Note that KDE used to use convenience libraries and is doing just fine 
> > without them.  They were really a hack in auto* because those tools 
> > did not support source files from a different directory when 
> > convenience libraries were first created.
> >
> > -Brad
> 
> Thanks, ok but, sorry to be thick, how do I reference a symbol defined 
> in CMakeLists.txt in another directory for a list of source files?
> 
> e.g. in lib/graph/CMakeLists.txt I have:
>     SET(graph_SRCS     
>           attribs.c agxbuf.c edge.c graph.c graphio.c lexer.c node.c 
> parser.c refstr.c trie.c
>     )
> and I want to expand this in lib/gvc/CMakeLists.txt


I created variables in a toplevel directory for all former static libs:

set(kfooStaticSrcs 
   ${CMAKE_SOURCE_DIR}/foo/blah.cpp 
   ${CMAKE_SOURCE_DIR}/foo/blub.cpp 
   ...
   )

set(kbarStaticSrcs 
   ${CMAKE_SOURCE_DIR}/bar/joe.cpp 
   ${CMAKE_SOURCE_DIR}/bar/bob.cpp 
...
   )

(it doesn't have to be the real toplevel dir, but a directory parent to all subdirs where the static libs were used.

Bye
Alex

-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl


More information about the CMake mailing list