[CMake] Remove custom targets

Glenn Coombs glenn.coombs at gmail.com
Mon Jul 4 19:40:51 EDT 2011


If you can modify the subdirectory cmakefiles then maybe you could protect
the declaration of the uninstall target like this:

if (NOT TARGET uninstall)
    add_custom_target(uninstall ...)
endif()

That way if the top level cmakefile declares an uninstall target it should
prevent the subdirectory versions from being declared.

--
Glenn


On 4 July 2011 17:33, Joe H <expipiplus1 at gmail.com> wrote:

> Hi all!
>
> I have a project, which pulls in a bunch of sub-projects, using
> add_subdirectory.
>
> The problem is that these projects all create a custom target called
> uninstall. Obviously, when these projects are pulled together, the uninstall
> targets clash.
> An ideal solution would be to ignore the uninstall targets in
> the subdirectories, and just pay attention to the one at the root. Is this
> at all possible?
>
> Thanks!
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110705/0b3d145d/attachment.htm>


More information about the CMake mailing list