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

Micha Hergarden micha.hergarden at gmail.com
Mon Jul 20 13:52:52 EDT 2015


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/2cd63f24/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150720/2cd63f24/attachment.sig>


More information about the CMake mailing list