[CMake] refering to top-level project as a target in a subdir's cmakelists.txt

MM finjulhich at gmail.com
Mon Jul 20 14:36:15 EDT 2015


On 20 July 2015 at 18:52, Micha Hergarden <micha.hergarden at gmail.com> wrote:

>  On 07/20/2015 05:16 PM, MM wrote:
>
> I want to refer to
>
>  == toplevl cmakelists file ===
> PROJECT(prj)
> ADD_SUBDIRECTORY(dir1)
>
>  ==dir1 cmakelists.txt===
> ADD_CUSTOM_COMMAND( TARGET prj  # this doesn't work
> )
>
>
>  In what way do you want to refer to it? You may want to use the DEPENDS
> parameter here. Do I understand correctly that you want to add a custom
> command that depends on the whole project the custom command is part of?
> Does that not imply a cyclic dependency?
>
> Regards,
> Micha
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150720/da2a1adc/attachment.html>


More information about the CMake mailing list