[CMake] Running custom executable

Daniel Dilts diltsman at gmail.com
Wed Apr 8 17:06:41 EDT 2015


The issue with the add_custom_command() and DEPENDS is that the custom
commands will be in CMakeLists.txt files throughout the solution, and it
appears to indicate that that form only works with a target created in the
same directory.

On Wed, Apr 8, 2015 at 1:12 PM, Alexander Neundorf <a.neundorf-work at gmx.net>
wrote:

> On Tuesday, April 07, 2015 15:24:18 Daniel Dilts wrote:
> > Looking at the way these things work, it seems to me that the ideal
> > solution to my situation, if it is possible, is to do a
> > add_custom_command() for each source file, and then do a
> > add_custom_target() that has all of the custom commands as PRE_BUILD
> events.
>
> No, PRE_BUILD works only for Visual Studio generators according to the
> docs.
>
> I think you need to give the list of output files generated using
> add_custom_command() as DEPENDS to add_custom_target().
>
> Alex
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150408/a1c724c8/attachment.html>


More information about the CMake mailing list