cmake - 使用 CMake FetchContent 时的目标冲突
问题描述
在 CMake 项目中,我使用 FetchContent 来获取两个依赖项。它们都定义了相同的目标(在这种情况下doc
),导致配置步骤出错:
CMake Error at thirdparty/penf/doc/CMakeLists.txt:7 (add_custom_target):
add_custom_target cannot create target "doc" because another target with
the same name already exists. The existing target is a custom target
created in source directory
"/home/me/project/thirdparty/flogging/doc". See
documentation for policy CMP0002 for more details.
我怎样才能避免这个目标冲突?
解决方案
推荐阅读
- powershell - Powershell:消息框崩溃做while循环
- c# - 退出子进程而不丢失数据
- python - 如何使用 split-Python 转换文档中的数据
- html - How to set how far down a page a HTML fragment links to?
- java - Comparing time is incorrect when picking 12:00
- python - 如何在 Maya python 中使用字典
- java - ValidationError FieldUndefined SPQR GraphQL
- java - 根据缩放级别在地图上缩放自定义标记
- wso2esb - Filter data from JSON by checking condition with two properties - WSO2 ESB
- php - PHP - 使用 imagecopy 函数垂直合并两个图像