如何与柯南一起正确使用Cmake子标题?

发布于 2025-01-29 11:28:13 字数 597 浏览 9 评论 0原文

假设我们有:

  • app cmake Project,该项目使用柯南来管理依赖项(通过conanfile.txt
  • lib lib cmake库库独立项目出于相同的目的,生活在单独的存储库中
  • libapp
  • applib依赖项的子标记。 在这种

情况下错误:

[cmake] CMake Error at build/conanbuildinfo.cmake:1507 (add_library):
[cmake] add_library cannot create imported target "CONAN_LIB::boost_boost_contract"
[cmake] because another target with the same name already exists.

处理此类案件的正确方法是什么?当我们嵌套了Cmake子标记以及父和嵌套的项目时,请使用柯南。

Let's say we have:

  • App CMake project which uses Conan to manage dependencies (via conanfile.txt)
  • Lib CMake library standalone project which also uses Conan for same purpose, lives in a separate repository
  • Lib is a subproject of App
  • Some of App and Lib dependencies in their own conanfile.txt files are same (let's say they both use boost/1.78.0)

In this case, App project fails to build with error:

[cmake] CMake Error at build/conanbuildinfo.cmake:1507 (add_library):
[cmake] add_library cannot create imported target "CONAN_LIB::boost_boost_contract"
[cmake] because another target with the same name already exists.

What's the proper way to handle such cases? When we have nested CMake subproject and both parent and nested project use Conan inside.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文