[CMake] Using objects in different targets

"Christoph Rüdiger" Christoph_R at gmx.de
Thu May 20 07:04:49 EDT 2010


Hi!

I'm new to cmake and couldn't find a solution for my problem:

I've a directory src containing the complete source code of the program and
another directory called test containing the source code for the unit tests.
In the top level directory is a CMakeLists.txt that points to the subdirectories containing each an own CMakeLists.txt for building the program or the unit tests.

Now I want to use the already build object files from the src directory one time for linking the program and one time for linking to the unit tests.

My current way is building a static library in the src directory and link the unit tests against this library. But the sources would be compiled twice: One time for the static library and one time for the program itself.


I thought unit tests were a standard think. But I didn't find a suitable answer asking google (maybe I used the wrong search terms)...


Christoph
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


More information about the CMake mailing list