[CMake] Running custom executable

Alexander Neundorf a.neundorf-work at gmx.net
Tue Apr 7 15:46:31 EDT 2015


On Monday, April 06, 2015 21:19:57 Klaim - Joël Lamotte wrote:
> On Mon, Apr 6, 2015 at 8:47 PM, Daniel Dilts <diltsman at gmail.com> wrote:
> > I have a custom executable that does some codegen to produce an
> > enumeration and a couple of tables.  I need this to be run against each
> > source file before actual compilation.  It needs include directories and
> > macro definitions from the build system.
> > 
> > Is there a way to do this with a CMake build system?  add_custom_command
> > seems like it might work, but I need all runs of the custom executable to
> > run before compilation begins.
> 
> execute_process() might be what you want:
> http://www.cmake.org/cmake/help/v3.2/command/execute_process.html


Hmmm, probably add_custom_command() or add_custom_target() is what he wants.
Why does it have to run before the compilation begins ?

Alex



More information about the CMake mailing list