[CMake] target issue

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Jul 26 11:04:27 EDT 2006


On 2006-07-26 08:46-0300 "Flávio P. Duarte" wrote:

> Hi,
> 	I am developing a project where I have a subdirectory with a bunch of
> programs. Those programs are being created with ADD_EXECUTABLE command.
> The main CMakeLists.txt include this dir using SUBDIRS command, which
> makes all programs in this directory. Since ADD_CUSTOM_COMMAND seems to
> add a target that is executed by default, I would like to know how I can
> change this behaviour by only creating those programs when the user
> explicitly invoke make with a target (make programs).

I haven't tried it myself yet (just a CMake newbie), but from the man page
it looks like this is what add_custom_target is for (without the ALL option).

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