[CMake] Newbie question
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Sun Feb 25 14:53:56 EST 2007
On 2007-02-25 13:34-0500 Christian Convey wrote:
> (Couldn't spot this in the docs - sorry if it's obvious...)
>
> I've got a project that involves a library, and several demo apps that
> use that library.
>
> - Is there a strong reason to avoid using a single CMake file to
> express the logic for building the library and the apps?
No. This is done all the time.
>
> - How do I express the fact that each app is dependent on the library
> already being built? (When I use "TARGET_LINK_LIBRARIES", cmake seems
> upset that the library, which hasn't yet been built, doesn't exist at
> the time I run cmake.)
You probably have to reorder how your targets are specified. The ADD_LIBRARY
and ADD_EXECUTABLE commands should occur before your TARGET_LINK_LIBRARIES
command.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
More information about the CMake
mailing list