[CMake] Running custom executable

Klaim - Joël Lamotte mjklaim at gmail.com
Mon Apr 6 15:19:57 EDT 2015


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


> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150406/33d90b57/attachment.html>


More information about the CMake mailing list