【发布时间】:2018-12-23 17:12:03
【问题描述】:
我在使用 bincrafters 构建的 1.69.0 版本的 Boost conan 包时遇到了问题。我在使用 libcurl 和 zlib 等其他 conan 软件包时没有问题。
我已经像这样写了一个conanfile.txt:
[requires]
boost_context/1.69.0@bincrafters/stable
boost_coroutine/1.69.0@bincrafters/stable
boost_date_time/1.69.0@bincrafters/stable
boost_filesystem/1.69.0@bincrafters/stable
boost_iostreams/1.69.0@bincrafters/stable
boost_program_options/1.69.0@bincrafters/stable
expat/2.2.5@bincrafters/stable
libcurl/7.56.1@bincrafters/stable
[generators]
cmake_find_package
在 CMakeLists.txt 中,我尝试像这样链接:
target_link_libraries(
llcommon PUBLIC
expat::expat
zlib::zlib
boost_coroutine::boost_coroutine
boost_context::boost_context
)
找到 Expat 和 Zlib 并顺利链接。不过,对于 boost* 库,我从 CMake 收到以下错误:
CMake Error at llcommon/CMakeLists.txt:243 (add_library):
Target "llcommon" links to target "boost_context::boost_context" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
我缺少有关 bincrafters 模块化 Boost 包的内容吗?或者我不能和他们一起使用conan_find_package 生成器吗?
【问题讨论】:
-
您是否已经尝试使用
boost::boost_coroutine? -
是的,我试过
boost::boost_coroutine和boost::coroutine都无济于事。 -
双重签入生成的
Findboost_coroutine.cmake,目标也定义为boost_coroutine::boost_coroutine。所以我认为那部分是正确的。