首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >vcpkg cmake找不到botan

vcpkg cmake找不到botan
EN

Stack Overflow用户
提问于 2018-08-29 23:45:23
回答 1查看 903关注 0票数 2

我使用vcpkg作为我的包管理器,按照示例,使用sqlite构建example非常容易。

之后,我成功地安装了botan,并尝试使用示例here中所示的find_package(botan REQUIRED)查找该库。然而,不幸的是,这并不起作用,生成过程退出时出现错误

代码语言:javascript
复制
CMake Error at vcpkg/scripts/buildsystems/vcpkg.cmake:247 (_find_package):
  By not providing "Findbotan.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "botan", but
  CMake did not find one.

  Could not find a package configuration file provided by "botan" with any of
  the following names:

    botanConfig.cmake
    botan-config.cmake

  Add the installation prefix of "botan" to CMAKE_PREFIX_PATH or set
  "botan_DIR" to a directory containing one of the above files.  If "botan"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:4 (find_package

CMakeLists.txt如下所示

代码语言:javascript
复制
cmake_minimum_required(VERSION 3.0)
project(botanTest)

find_package(botan REQUIRED)

add_executable(main main.cpp)
target_link_libraries(main botan)

有没有办法用cmake和vcpkg构建一个依赖botan的应用程序?如果不是cmake,如何使用botan作为vcpkg包呢?硬编码位置不是一个可行的解决方案。

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2019-07-18 14:56:14

vcpkg不为构建和安装的Botan提供配置文件。

您必须在CMake项目中直接使用find_path()和find_library(),或者编写一个可通过find_package()调用找到的FindBotan.cmake文件。在这个FindBotan.cmake中,您仍然需要使用find_path()和find_library(),以及其他一些出现在Find模块中的常用样板。

如果你在互联网上搜索,你已经可以找到FindBotan.cmake的一些版本,但没有一个是官方的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52081449

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档