How to handle build rule with unknown targets in OMake when target list generator is built

Posted by Michael E on Stack Overflow See other posts from Stack Overflow or by Michael E
Published on 2010-03-26T18:37:57Z Indexed on 2010/03/28 21:13 UTC
Read the original article Hit count: 216

Filed under:
|

I have a project which uses OMake for its build system, and I am trying to handle a rather tough corner case.

I have some definition files and a tool which can take these definition files and create GraphViz files. There are two problems, though:

  • Each definition file can produce multiple graphs, and the list of graphs it can produce is encoded in the file. My dump tool does have a -list option which lists all the graphs a definition file will produce.
  • This dump tool is built in the source tree.
  • I want this list available in the OMakefile so I can use other rules to convert the DOT files to SVG, and have a phony target depend on all the SVGs (goal: a single build command which builds SVG descriptions of all my graphs).

If I only had the first problem, it would be easy - I would run the tool to build a list, and then use that list to build a target which invokes the dumper to output the GraphViz files. However, I am rather stuck on forcing the dump tool to be built before it is needed.

If this were make, I would just run make recursively to build the dump tool. OMake does not allow recursive invocation, however, and the build function is only usable from osh.

Any suggestions for a good solution to this problem?

© Stack Overflow or respective owner

Related posts about omake

Related posts about build-system