My Mercurial repository repo1 has a custom target named foo
; never mind what it does. I also have another repository repo2, which which I want to use as a subrepo of repo1. repo2 is developed in a similar fashion to repo1, and also has a custom target named foo
, doing about the same thing (but just for the repo2 directory of course).
If I try to run CMake for repo1 with add_subdirectory(relative/path/to/repo2)
in the CMakeLists.txt
, I get:
CMake Error at CMakeLists.txt:123 (add_custom_target):
add_custom_target cannot create target "foo" because another target with
the same name already exists. The existing target is a custom target
created in source directory
I suppose I could just prefix the custom target names with the repository names, but that seems like a crude solution to this problem; and I kind of like the fact that make foo
does the same thing, conceptually, both in repo1 and in repo2. So is there anything smarter I can do here?