[CMake] Linking several executables to the same object files

Brandon Van Every bvanevery at gmail.com
Sat Jun 30 02:58:37 EDT 2007


On 6/29/07, Stuart Herring <cmake at stuartherring.com> wrote:
> On 6/30/07, Daniel Gruen <daniel_gruen at web.de> wrote:
> > Just one question: I have a project including several executables that all
> > link to a set of common .o files (and I don't want to make a library out of
> > it). Is there a way to prevent cmake from compiling them over and over again?
> > Currently, it does (just having specified all the add_executables(something1
> > commonfile1.cpp commonfile2.cpp commonfile3.cpp something1.cpp)), and the
> > common source files will be compiled into object files for every executable
> > anew, taking quite a lot more time than with simple commonfile.o targets in
> > the previous Makefile.
> >
> Why don't you want to make a library out of them?

Probably because he's faking a convenience library.  Chicken does
this.  http://www.call-with-current-continuation.org
Look at how libpcre is reused.


Cheers,
Brandon Van Every


More information about the CMake mailing list