[CMake] Custom-Targets with unknown outputs

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed May 14 00:52:11 EDT 2008


On 2008-05-14 06:24+0200 Christoph Cullmann wrote:

> Hi,
>
> what's a good way to integrate a custom target that works like the following:
>
> We have a generator, that takes some known files (like bison or flex) but
> instead of generating few known ones, it will generate a full subdir of
> source files with not predictable names.

That's an intriguing question.  Assuming the above is already done with
ADD_CUSTOM_COMMAND, how about adding another COMMAND (see the documentation
of ADD_CUSTOM_COMMAND for the syntax for multiple COMMANDs) that runs CMake
-E touch filename at run time?  This will create (or change create time) for
an empty output file with a fixed unique name of your choice that can be
used as a file dependency for a custom target.

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 libLASi project (unifont.org/lasi); 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