我的 Mercurial 存储库 repo1 有一个名为的自定义目标foo
;别管它做了什么。我还有另一个存储库 repo2,我想将其用作 repo1 的子存储库。repo2 以与 repo1 类似的方式开发,并且还有一个名为 的自定义目标foo
,做同样的事情(当然只是针对 repo2 目录)。
add_subdirectory(relative/path/to/repo2)
如果我尝试在中为 repo1 运行 CMake CMakeLists.txt
,我会得到:
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
我想我可以在自定义目标名称前加上存储库名称,但这似乎是解决这个问题的粗略方法;我有点喜欢make foo
在 repo1 和 repo2 中在概念上做同样事情的事实。那么我可以在这里做些什么更聪明的事情吗?