[CMake] target name collision

Jakub Zakrzewski jzakrzewski at e2e.ch
Thu Mar 27 10:30:53 EDT 2014


Is there a reason, why you treat your independent projects with add_directory() instead of making them external projects?

--
Gruesse,
Jakub


From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Aurelien Richez
Sent: Donnerstag, 27. März 2014 14:58
To: cmake at cmake.org
Subject: [CMake] target name collision

Hi,

I have two project that are independent and can be compiled on their own. I also have a bigger project which include these two project with add_subdirectory. However, these projects contain targets with the same names. As a consequence, cmake 2.8 complains with a message such as "another target with the same name already exists" when I try to generate the makefile.

Isn't there a way to handle this situation which does not involve renaming the targets in the subproject ? Like an option to automatically add a prefix to target added from add_subdirectory (for instance, target "doc" in "subproject1" would become "subproject1/doc" in the upper project).

Thanks,

Aurélien Richez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140327/cc09655c/attachment.html>


More information about the CMake mailing list