[CMake] Are target dependencies always processed before file dependencies for custom targets?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Oct 30 17:44:07 EST 2006


I have the following situation:

One subdirectory has a complicated target build (a library).  Another
subdirectory has a custom command which only works if the library is built
first.

I know of no way to directly get a custom command to depend on a target.

The current solution is to create a custom target that file-depends on
the custom command (via the DEPENDS subcommand of add_custom_target) and
target-depends (via add_dependencies) on the library target.

This solution appears to work, but I am concerned I might be storing up
trouble for the future or maybe even now for the make -j case, for example.
Can I count on target-depends for my custom target _always_ being processed
before file-depends?

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