[CMake] Auto-convert all IDL files in a tree?

Dave Wolfe dwolfe at gforcetech.com
Sat Jun 23 18:54:19 EDT 2007


> > I have a project with some (home-brewed) IDL files that I need to run
> > a python script on to convert to CPP.  Some of these IDL files
> > include other IDL files, which may, in turn, include *other* IDL
> > files...


> It appears from what you have said, that ...
>                                     you need to deal with the
> dependencies dynamically at build time rather than cmake time.

Yes, that seems to be the case.

> If you were willing to accept static idl dependencies then you could
> use EXECUTE_PROCESS to run your python script to generate the cpp file
> and determine a static list of idl dependencies at cmake time, and use
> ADD_CUSTOM_COMMAND to regenerate the cpp file (if necessary) at build
> time (i.e., make time) if any of the static list of dependencies has
> been changed/edited (aside from changes to include commands).  Of
> course, you could remove the cache file and rerun cmake to update the
> list of static dependencies that are paid attention to in the
> Makefile, but that takes human understanding of when the include
> statements have changed so the procedure is subject to human error but
> may be a compromise that reasonably satisfies your needs.


Hmm.  Is there a way to 'fake out' CMake so it re-runs itself the next
time a target is built?  Maybe make a build rule that touches the
top-level CMakeLists.txt file, or some other file?  That wouldn't be a
perfect solution, but it would be good enough, I think...




More information about the CMake mailing list