Bincrafters模块化柯南软件包和cmake_find_package生成器

时间:2018-12-23 17:12:04

标签: cmake conan bincrafters

使用bincrafters构建的Boost柯南包1.69.0版本时遇到了问题。使用其他柯南软件包,例如libcurl和zlib,我没有任何问题。

我已经这样写了一个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生成器?

1 个答案:

答案 0 :(得分:0)

已解决。我没有更新do{ printf("go\n"); scanf("%19s%19s%d",name,sname,&age); fprintf(potr,"%s %s %d",name,sname,age); printf("\ny or n :"); scanf(" %c",&go); /* whitespace before %c */ }while(go == 'y' || go == 'Y'); 通话。

find_package

丢失了

显然,我需要注意下一次CMake错误告诉我什么。