我使用vcpkg作为我的包管理器,按照示例,使用sqlite构建example非常容易。
之后,我成功地安装了botan,并尝试使用示例here中所示的find_package(botan REQUIRED)查找该库。然而,不幸的是,这并不起作用,生成过程退出时出现错误
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_packageCMakeLists.txt如下所示
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包呢?硬编码位置不是一个可行的解决方案。
谢谢你的帮助。
发布于 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的一些版本,但没有一个是官方的。
https://stackoverflow.com/questions/52081449
复制相似问题